Skip to content Skip to sidebar Skip to footer

C# Htmlagilitypack Xpath Select All Except With Certain Class

I am trying to select all li tags on a page that do not have the class='r' What i have so far is: .//li This is what ive tried so far //li[not([@class='r'])] With that i get the

Solution 1:

use this expression //li[not(@class='r')]

var lis = htmlDoc.DocumentNode.SelectNodes("//li[not(@class='r')]")

Post a Comment for "C# Htmlagilitypack Xpath Select All Except With Certain Class"