I am working on an HTML parsing related utility. During this work HTML Agility Pack is helping me so much.
I am just having a problem, in parsing some html content which is malformed. I want to get all the forms of the html and process them one by one. But on of my forms has an unclosed <li> tag, due to which, the html agility parser, brings all the html
present after its parent form in it.
Now, when I do something like this:
var _document = new HtmlDocument();
_document.OptionAutoCloseOnEnd = true;
var formNodes = _document.DocumentNode.SelectNodes("//form");
foreach (var node in formNodes)
for second form node, it will emit html of form3 and form4 as well.
Any help will be highly appreciated.