Mar 5, 2010 at 8:54 PM
Edited Mar 6, 2010 at 8:16 AM
I am trying to find all div elements that have a class="business" attribute. If I try :
HtmlNodeCollection nc = doc.DocumentNode.SelectNodes("//div[@class='business']");
Here is some example html :
<div><p>nested div 1</p></div>
<div><p>nested div 2</p></div>
The node collection (nc variable) contains the 2 nested divs but not the outer div (not the div with class="business" attribute. I've tried using / instead of // in the xpath, also no slashes at all but they return no results at all.