相关疑难解决方法(0)

HtmlAgility - 将解析保存为字符串

刚尝试首次使用HtmlAgility Pack并遇到问题.

首先我从字符串变量加载.

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

然后我想将我的更改保存在字符串NewsText中.我怎么做?htmlDoc.toString()没有用.

谢谢!

c# parsing html-parsing

25
推荐指数
1
解决办法
8160
查看次数

如何将html doc保存到字符串中?

 HtmlDocument doc = new HtmlDocument();
    doc.Load(yourhtml);
    doc.Save(Console.Out);
Run Code Online (Sandbox Code Playgroud)

如何将其保存为字符串而不是Console.Out

c# dom data-conversion

3
推荐指数
1
解决办法
4036
查看次数

标签 统计

c# ×2

data-conversion ×1

dom ×1

html-parsing ×1

parsing ×1