Html Agility Pack unclosed embed, param tags

.net asp.net c# html-agility-pack

Question

Try parsing the embed-object element as follows:

HtmlNode source2 = HD.CreateElement("source"); source2.InnerHtml =

<object width="640" height="390" ><param name="movie" value="http://videa.hu/flvplayer.swf?v=SMxjdkVDqmrfAxJz" /><param name="allowscriptaccess" value="always" /><param name="allowFullScreen" value="true" /><embed width="640" height="390" src="http://videa.hu/flvplayer.swf?v=SMxjdkVDqmrfAxJz" allowscriptaccess="always" allowfullscreen="true" type="application/x-shockwave-flash" /></object><br /><a href="http://videa.hu/videok/jarmuvek/markoloval-tisztitjak-a-parkolot-az-SMxjdkVDqmrfAxJz"> title="fdsdf sdf">dsdfs fs dfsd fsd </a>n here.

When I attempt the document code, there is an issue.HD.DocumentNode.OuterHtml or source2.InnerHtml The embed tag and parameter will both be open.

A try

HtmlNode.ElementsFlags["param"] = HtmlElementFlag.Closed;

nonetheless, acquire a closer tag.

thanks

1
1
12/15/2012 11:04:13 AM

Popular Answer

Try it,

 HtmlAgilityPack.HtmlDocument document = new HtmlAgilityPack.HtmlDocument();
 document.LoadHtml(loadhtmlstring);
 document.OptionFixNestedTags = true;

Try to correct the html tags while loading the html into the HTML document. Afterward, you may resolve your issue. It enables the automated correction of HTML tag mistakes.

2
12/15/2012 11:26:09 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow