HtmlAgility - Save parsing to a string

懵懂的女人 提交于 2019-12-21 06:49:02

问题


Just tried using the HtmlAgility Pack for the first time and have a problem.

First I load in from a string variable.

string NewsText = dr["Message"].ToString();
HtmlAgilityPack.HtmlDocument htmlDoc = new HtmlAgilityPack.HtmlDocument();
htmlDoc.LoadHtml(NewsText);
//doing my stuff...

Then I want to save my changes in the string NewsText. How do I do that? htmlDoc.toString() didnt work.

Thanks!


回答1:


You're looking for htmlDoc.DocumentNode.OuterHtml.



来源:https://stackoverflow.com/questions/5107302/htmlagility-save-parsing-to-a-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!