That depends on what extractNodeValue()
actually does (and you have not shared the code), however by its name it extracts the node-value. And the node value of the <a>
element is
"Name of the link"
So you should specify the node instead of which you want to retrieve the value of. The <a>
element is normally known as link, so no clue what you mean. Probably the href
attribute?
See as well:
Edit: I see now the changed title, you are indeed interested in the href
attribute. It works as outlined in the link above, just prefix the attribute name with the @
-symbol to make clear you are looking for an attribute:
.../a/@href
This is looking for the href
attribute of the <a>
element. Elements in Xpath are parent of the attributes they have. But the attributes are no children. ?! This is different to the DOM, see as well: