使用 XPath 获取带有 id 的标签的 href 属性
Get href attribute of a tag with id using XPath
如何获得 returns:
的 Xpath
//www.example.com
与以下 DOM:
<a id="myId" href="//www.example.com">
Click here</a>
//a[@id='myId']/@href
这应该可行,只需将其实现到您使用 xpath 的任何语言中即可。
如何获得 returns:
的 Xpath//www.example.com
与以下 DOM:
<a id="myId" href="//www.example.com">
Click here</a>
//a[@id='myId']/@href
这应该可行,只需将其实现到您使用 xpath 的任何语言中即可。