So I'm aware of how to select a node using htmlagilitypack:
HtmlNode.SelectNodes(".//div[@class='description']")
etc... but say I have a site set up in the following way:
<a href="/link1/">This is Link 1</a>
<a href="/link2/">This is information i want to get to</a>
<a href="/link3/">This is Link 3</a>
<a href="/link4/">This is information i want to get to</a>
<a href="/link5/">This is Link 5</a>
<a href="/link6/">This is Link 6</a>
etc...
Now, the snippet is short, but basically, The links are asymmetric, and I only want to access links that have the text value
"this is information i want to get to"
(I'm not familiar enough with hmtl to use proper terminology here, sorry). Is there a method in htmlagilitypack where I can check this text value?
Thank you!
Try using the text()
function:
SelectNodes("a[text()='This is information i want to get to']")
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