HtmlDocument doc = new HtmlDocument();
doc.Load("file.htm");
foreach(HtmlNode link in doc.DocumentNode.SelectNodes("//a[@href]"))
{
HtmlAttribute att = link.Attributes["href"];
yourList.Add(att.Value)
}
doc.Save("file.htm");
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3335 次 |
| 最近记录: |