I am trying to get the Html Agility Pack to work in my case. I need to detect all script elements on an existing HTML page and delete them, saving the changes in another file. Here bodyNode returns the correct number of script tags, but I cannot remove them. The new file still has those tags.
if (doc.DocumentNode != null) { var bodyNode = doc.DocumentNode.SelectNodes("//script"); if (bodyNode != null) { bodyNode.Clear();
user246392
source share