Get the whole HTML page as a string using HtmlAgilityPack.

c# html-agility-pack

Question

Does HtmlAgilityPack have the ability to return the whole HTML markup from an HtmlDocument object as a string?

1
71
10/2/2015 10:15:21 AM

Accepted Answer

Sure, you can do like this:

HtmlDocument doc = new HtmlDocument();
// call one of the doc.LoadXXX() functions
Console.WriteLine(doc.DocumentNode.OuterHtml);

OuterHtml contains the whole html.

123
3/3/2011 5:40:43 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