I\'m having difficulty trying to remove a div with a particular ID, and its children using the HTML Agility pack. I am sure I\'m just missing a config option, but its Friday a
You can simply call:
var documentNode = document.DocumentNode; var functionBarNode = documentNode.SelectSingleNode("//div[@id='functionBar']"); functionBarNode.Remove();
It is much simpler, and does the same as:
functionBarNode.ParentNode.RemoveChild(functionBarNode, false);