I am trying to select nodes except from script nodes and a ul that has a class called 'relativeNav'. Can someone please direct me to the right path? I have been searching for this for a week and I can't find it anywhere. Currently I have this but it obviously selecting the //ul[@class='relativeNav'] as well. Is there anyway to put an NOT expression of it so that SelectNode will ignore that one?
foreach (HtmlNode node in doc.DocumentNode.SelectNodes("//body//*[not(self::script)]/text()"))
{
Console.WriteLine("Node: " + node);
singleString += node.InnerText.Trim() + "\n";
}