I use C # with HtmlAgilityPack and I can select divs that have id foo
var foos = from foo in htmlDoc.DocumentNode.Descendants("div") where foo.Id == "foo" select foo;
but how to select a div with class bar?
You can use XPATH like this
//div[@class='bar']
or
//*/div[@class='bar']
You can also do && foo.Class == "bar".
foo.Class == "bar"