public async Task <CrawlResult> CrawlAsync() { IXmlConfigReader xmlConfigReader = new XmlConfigReader(ConfigXMLFileName, ConfigXSDFileName, TargetNamespace); Config config = xmlConfigReader.ReadConfig(); ISimpleWebCrawler webCrawler = new SimpleWebCrawler(config.Depth); return(await webCrawler.PerformCrawlingAsync(new List <string>(config.RootUrls))); }
private void treeView_Loaded(object sender, RoutedEventArgs e) { ISimpleWebCrawler crawler = new SimpleWebCrawler(1); //CrawlResult res = crawler.PerformCrawlingAsync(new[] { "http://localhost/" }).Result; treeView.DataContext = Conv(new List <UrlModel>()); }
static void Main(string[] args) { SetAllowUnsafeHeaderParsing20(); ISimpleWebCrawler crawler = new SimpleWebCrawler(2); CrawlResult res = crawler.PerformCrawlingAsync(new [] { "http://oz.by/books/more10480814.html" }).Result; res = res; Thread.Sleep(20000); res = res; }