I got for example
<a href="target.php">News</a>
<a href="more.php">More</a>
What would be the most efficient way of extracting the href based on the value between <a></a> (the atomic data) with XPath
Question interpretation:
a tags.This XPath selects all a elements,
//a
This XPath selects all a elements whose string value is "News":
//a[.='News']
This XPath selects all href attributes of all a elements whose string value is "News"1:
//a[.='News']/@href
1. Credit: @localghost posted correct answer in comments
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With