AgainMe AgainMe - 1 year ago 55
C# Question

Prevent HtmlAgilityPack to select particular class

I need to select all

inside a table, actually for doing this I wrote this code:

var tr = doc.DocumentNode.SelectNodes("//tr");

this working good, but I need to skip the tr that have this class:
round-head expanded loaded

Is possible tell to
to select all tr that doesn't have the class specified above? thanks.

Answer Source

Simply use the Xpath to check the value of an attribute:

//tr[@class != 'round-head expanded loaded']