choose a> tag with given inner text with htmlagilitypack

.net html-agility-pack xpath

Question

i need to select a tag that contains an innertext i specify. can anyone help me with the xpath query ie <a href="#">wake up</a>. So if i pass wake to the xpath, it should select this a link

thanks

1
4
1/2/2012 12:40:28 PM

Accepted Answer

The XPath is simply //a[starts-with(., 'wake')].

9
1/2/2012 12:48:52 PM

Popular Answer

One way (it matches case sensitive):

//a[contains(text(), 'wake')]


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow