How to get raw text from HTML agility pack

html-agility-pack

Question

Quick question, how do I get all raw text (i.e., removing all html tags) using html agility pack?

HtmlDocument doc = new HtmlDocument();
        doc.Load(html);
1
1
9/2/2011 5:12:37 PM

Accepted Answer

If you download source code from Html Agility Pack page (look for "Html Agility Pack 1.4.0 Source" file) there is folder Html2Txt that contains the code you need (look for the HtmlToText class in HtmlConvert.cs file).

3
9/2/2011 5:29:45 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow