HtmlAgilityPack:获取全HTML文档字符串 [英] HtmlAgilityPack: Get whole HTML document as string

查看:124
本文介绍了HtmlAgilityPack:获取全HTML文档字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问HtmlAgilityPack必须退回的的从的HTMLDocument对象作为字符串的HTML标记?


解决方案

当然,你可以这样做:

 的HTMLDocument DOC =新的HTMLDocument(); 
//调用doc.LoadXXX之一()函数
Console.WriteLine(doc.DocumentNode.OuterHtml);



OuterHtml包含整个HTML。


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

解决方案

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.

这篇关于HtmlAgilityPack:获取全HTML文档字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆