I'm using HTML Agility Pack to parse and transform a HTML file, but I get an exception "Item has already been added" when try to create a new HTMLNode because of the index parameter.
HtmlNode node1 = new HtmlNode(HtmlNodeType.Element, doc, 0);
node1.Name = "div";
HtmlNode node2 = new HtmlNode(HtmlNodeType.Element, doc, 0);
node2.Name = "div";