Thursday, December 5, 2013

How to extract text from html tages?


By HtmlAgilityPack

HtmlDocument doc = new HtmlDocument();
            doc.LoadHtml(htmlstring);
            string text = doc.DocumentNode.InnerText;
            text = Regex.Replace(text, @"\s+", " ").Trim();

No comments:

Post a Comment