Can't seem to remove nodes

Topics: User Forum
Apr 29, 2016 at 11:49 PM
Embarrasingly trivial problem, but I've only ever used HAP for scraping websites and never tried to manipulate the html.

I'm trying to remove an img node and neither of the approaches listed below seem to work.

HtmlAgilityPack.HtmlNode tipGif = 
                    doc.DocumentNode.SelectSingleNode("//img[@src = '']");

                if (tipGif != null)
                    var nodesToRemove = doc.DocumentNode
                    .SelectNodes("//img[@src = '']")

                    foreach (var node in nodesToRemove)
var RL = doc.DocumentNode.SelectSingleNode("//img[@src = '']");
I think I'm missing something fundamental about how this method works. I can post an example of the html but it's very vanilla.

Thanks in advance.