HtmlAgilityPack invalid markup

↘锁芯ラ 提交于 2019-12-02 05:12:31
Gabe

I fixed this by commenting out line 92 of HtmlNode.cs in the source, compiled and it worked like a charm.

ElementsFlags.Add("option", HtmlElementFlag.Empty); // comment this out

Found the answer on this question

In HTML the tag has no end tag.

In XHTML the tag must be properly closed.

http://www.w3schools.com/tags/tag_option.asp

"There is also no adherence to XHTML or XML" - HTML Agility Pack.

This could be why? My guess is that if the tag is optional, the Agility Pack will leave it off. Hope this helps!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!