this is the part of my code
<div>
<div style="PADDING-BOTTOM: 4px"> blah </div>
<div style="PADDING-BOTTOM: 2px"> blah </div>
<div>
how can I select 2nd and 3rd divs into 'node.SelectNodes' ?
HtmlNode node = doc.DocumentNode.SelectSingleNode(".//div[@style='PADDING-BOTTOM: 2px']");
Can I do some sort of wilcard search for 2px and 4px or any other px?
You can use contains()
to do a string-in-string match.
node = doc.DocumentNode.SelectSingleNode(".//div[contains(@style, 'PADDING-BOTTOM:')]");