代码拉取完成,页面将自动刷新
An asynchronous web scraper / web crawler using async / await and Reactive Extensions
var httpClient = new HttpClient {UserAgentName = "mybot"}; //optional UserAgentName
var scraper = new Scraper(httpClient, new ScrapedUrisDictionary()); //use built in IHttpClient and IScrapedUris implementations
var io = new ImageScraperObserver(httpClient, new FileWriter(new DirectoryInfo("c:\\temp")));
scraper.Subscribe(io); //use built in image scraper
scraper.Subscribe(new ConsoleWriterObserver()); //use built in console writer
scraper.Subscribe(x => Console.WriteLine(x.Uri)); //implement your own subscriber
scraper.MaxDepth = 2; //optional
scraper.TimeOut = TimeSpan.FromMinutes(5); //optional
scraper.IgnoreLinks = new Regex("spam"); //optional - ignore links in page
scraper.IncludeLinks = new Regex("stuff"); //optional - scrape links in page
scraper.ObserverLinkFilter = new Regex("things"); //optional - trigger observers when link matches
scraper.DisableRobotsProtocol = true; //optional
scraper.Scrape(new Uri("http://www.mywebsite.com/")).Wait();
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。