HTML Agility Pack
Similar API for XmlDocument , for example (on the example page):
HtmlDocument doc = new HtmlDocument(); doc.Load("file.htm"); foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href"]) { HtmlAttribute att = link["href"]; att.Value = FixLink(att); } doc.Save("file.htm");
(you can also use LoadHtml to load the html string, not from the path)
source share