I am using C# with HtmlAgilityPack and I can select divs that have an id of foo
var foos = from foo in htmlDoc.DocumentNode.Descendants("div")
where foo.Id == "foo"
select foo;
but how do I select div's with a class of bar?
You can use XPATH like this
//div[@class='bar']
or
//*/div[@class='bar']
You also may be able to do && foo.Class == "bar"
.
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