preceding-sibling Xpath (using HtmlAgilityPack and VB)

html-agility-pack vb.net xpath

Question

To utilize Xpath with HTML documents, I'm using HtmlAgilityPack/HAP.

Help me choose the sibling that comes before class="address" div in this link. zzz -13-zzz I want a sibling named listingTitleLine in h3.

Here is an example:

http://i55.tinypic.com/25gc4qo.png Please give me some assistance.

-Dd,

1
1
9/13/2010 3:10:49 AM

Accepted Answer

To choose thepreceding-sibling listingTitleLine is the class property value for the H3 element.

preceding-sibling::h3[@class='listingTitleLine']

To choose all H3 elements with the class attribute value "linstingTitleLine" that are siblings to div elements with the class attribute value "address," use the following syntax:

//div[@class='address']/preceding-sibling::h3[@class='listingTitleLine']
0
9/12/2010 6:54:03 PM


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