Reputation: 1837
I am loading HTML passed as string into HTMLAgilityPack document as below.
HtmlDocument html = new HtmlDocument();
html.OptionOutputAsXml = true;
html.LoadHtml(htmlText);
HtmlNode document = html.DocumentNode;
After loading the document.InnerHtml shows up with "(sample below) for all the quotes.How can I avoid this?
<span style=\"\\"MARGIN-LEFT:\" class=\"\\"form_title\\"\" _20px5c_22_=\"\">MyText</span>
I would want the sample to be displayed as below.
<span class=\"form_title\" style=\"MARGIN-LEFT: 20px\">MyText</span>
From the obtained "document" I have to loop and find elements(using fizzler component). But with """ appearing I am not able to do so.
Upvotes: 1
Views: 13385
Reputation: 1837
Issue resolved after adding
HtmlAgilityPack.HtmlNode.ElementsFlags.Remove("form");
HtmlDocument html = new HtmlDocument();
html.OptionAutoCloseOnEnd = true;
Upvotes: 4