I want to replace a node with a new node. How can I get the exact position of the node and do a complete replace?
I\'ve tried the following, but I can\'t figured out
Have Implemented the following solution to achieve the same.
var htmlStr = "bold_onestrongbold_two";
var htmlDoc = new HtmlDocument();
HtmlDocument document = new HtmlDocument();
document.Load(htmlStr);
htmlDoc.DocumentNode.SelectSingleNode("//div[@class='olddiv']").Remove();
htmlDoc.DocumentNode.SelectSingleNode("//div[@class='LatestLayout']").PrependChild(newChild)
htmlDoc.Save(FilePath); // FilePath .html file with full path if need to save file.
so selecting an object and removing respective HTML object
and appending it as chile. of respective object.