0

How do I get the Xpath that returns:

//www.example.com

With the following DOM:

<a id="myId" href="//www.example.com">
Click here</a>
  • 2
    possible duplicate of [Getting attribute using XPath](http://stackoverflow.com/questions/4531995/getting-attribute-using-xpath) (based on question title, it should be something like `/a[@id='myId']/@href`) – Daniel Haley Mar 11 '15 at 22:23

1 Answers1

1
//a[@id='myId']/@href

That should work, just implement it into whatever language you're using xpath with.

Geoherna
  • 3,523
  • 1
  • 24
  • 39