Grab inner text from HTML that isn't from a header
Using HTMLAgilityPack for C#, how would I go about grabbing the inner text
from the HTML that isn't from a . I don't want to use Regular Expressions,
but HTMLAgilityPack.
My current approach:
var document = new HtmlDocument();
document.LoadHtml (text);
text = document.DocumentNode.SelectSingleNode ("//body").InnerText;
This has issues and doesn't quite work when dealing with a large range of
text. It would be better to remove the header tags and then grab the inner
text.
Thanks!
No comments:
Post a Comment