Reputation: 151
I'm using HtmlAgilityPack to parse HTML. I want to get the number of elements which have inline style.
Something like:
HtmlDocument.DocumentNode.SelectNodes("//*[has('@style')]").count
Upvotes: 0
Views: 454
Reputation: 2372
You could use
doc.DocumentNode.SelectNodes("//*[@style]").Count
You do not need to specify a value for the given attribute.
Upvotes: 1