Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HtmlAgilityPack: Get whole HTML document as string

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

like image 853
deostroll Avatar asked Mar 03 '11 16:03

deostroll


1 Answers

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.

like image 155
Simon Mourier Avatar answered Nov 07 '22 02:11

Simon Mourier