Mar*_*ell 28
该HTML敏捷性包可以做到这一点-只要使用像// IMG的查询和访问SRC -就像这样:
string html;
using (WebClient client = new WebClient()) {
html = client.DownloadString("http://www.google.com");
}
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(html);
foreach(HtmlNode img in doc.DocumentNode.SelectNodes("//img")) {
Console.WriteLine(img.GetAttributeValue("src", null));
}
Run Code Online (Sandbox Code Playgroud)