我将超文本标记语言作为字符串加载到HTMLAgilityPack文档,如下所示。
HtmlDocument html = new HtmlDocument();
html.OptionOutputAsXml = true;
html.LoadHtml(htmlText);
HtmlNode document = html.DocumentNode;加载document.InnerHtml后,显示“(下面的示例)所有的quotes.How我能避免这个吗?”
<span style=\"\\"MARGIN-LEFT:\" class=\"\\"form_title\\"\" _20px5c_22_=\"\">MyText</span>我希望样本显示如下。
<span class=\"form_title\" style=\"MARGIN-LEFT: 20px\">MyText</span>从获得的“文档”中,我必须循环并查找元素(使用fizzler组件)。但随着“”的出现,我无法做到这一点。
发布于 2013-02-20 23:24:22
添加后问题已解决
HtmlAgilityPack.HtmlNode.ElementsFlags.Remove("form");
HtmlDocument html = new HtmlDocument();
html.OptionAutoCloseOnEnd = true;https://stackoverflow.com/questions/14961759
复制相似问题