Need a bit of help with HTML Agility Pack!
Basically I want to grab plain-text withing the body node of the HTML. So far I have tried this in vb.ne
Jeff's solution is ok if you haven't tables, because text located in the table is sticking like cell1cell2cell3. To prevent this issue use this code (C# example):
var words = doc.DocumentNode?.SelectNodes("//body//text()")?.Select(x => x.InnerText);
return words != null ? string.Join(" ", words) : String.Empty;
How about:
Return htmldoc.DocumentNode.SelectSingleNode("//body").InnerText