HtmlAgility - Save parsing to a string

2019-04-03 12:47发布

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条回答
淡お忘
2楼-- · 2019-04-03 13:03

You're looking for htmlDoc.DocumentNode.OuterHtml.

查看更多
登录 后发表回答