In my code, I want to remove the img tag which doesn\'t have src value. I am using HTMLAgilitypack\'s HtmlDocument object. I am finding the img whic
var emptyElements = doc.DocumentNode .Descendants("a") .Where(x => x.Attributes["src"] == null || x.Attributes["src"].Value == String.Empty) .ToList(); emptyElements.ForEach(node => { if (node != null){ node.Remove();} });