I'm parsing and transforming an HTML file using HTML Agility Pack, but when I attempt to create a new HTMLNode due to the index argument, I receive an issue saying "Item has already been inserted."
HtmlNode node1 = new HtmlNode(HtmlNodeType.Element, doc, 0); node1.Name = "div"; HtmlNode node2 = new HtmlNode(HtmlNodeType.Element, doc, 0); node2.Name = "div";
This is how a node is created (intentionally imitating System.Xml semantics):
HtmlNode div = doc.CreateElement("div"); myNode.Append(div);
I'm not familiar with the constructor you use; maybe a new one will be made available in version 1.4?