Removing useless TextNodes in HtmlAgilityPack
I'm scraping a number of websites using HtmlAgilityPack. The problem is that it seems to insist on inserting TextNodes in most places which are either empty or just contain a mass of \n, whitespaces and \r.

They tend to cause me issues when I'm counting childnodes , since firebug doesn't show them, but HtmlAgilityPack does.

Is there a way of telling HtmlAgilityPack to stop doing it, or at least clearing out these textnodes? (I want to keep USEFUL ones though). While we're here, same thing for Comment and Script tags.
Removing useless TextNodes in HtmlAgilityPack
===

I'm scraping a number of websites using HtmlAgilityPack. The problem is that it seems to insist on inserting TextNodes in most places which are either empty or just contain a mass of \n, whitespaces and \r.

They tend to cause me issues when I'm counting childnodes , since firebug doesn't show them, but HtmlAgilityPack does.

Is there a way of telling HtmlAgilityPack to stop doing it, or at least clearing out these textnodes? (I want to keep USEFUL ones though). While we're here, same thing for Comment and Script tags.