How to get raw text from HTML agility pack

html-agility-pack

Question

A quick question: utilizing HTML Agility Pack, how can I extract all raw text (i.e., deleting all html tags)?

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

Accepted Answer

If you download the source code from Agility Pack in HTML (search for the "HTML Agility Pack Source 1.4.0" file), the necessary code is located in the subdirectory Html2Txt (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