HtmlAgilityPack....
Next time - search for an answer before. This is duplicate for sure.
Arnis L.
2010-03-03 10:19:56
HtmlAgilityPack....
Next time - search for an answer before. This is duplicate for sure.
You just asked an almost identical question and deleted it. Here was the answer I gave before:
Try the HTML Agility Pack.
Here's an example:
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");
Regarding your extra question regarding regex: do not use Regex to parse HTML. It is not a robust solution. The above library can do a much better job.