Exemplo n.º 1
0
        public ImageCrawler(ICrawlerRules<HtmlDocument> rules, ICrawlerProcesser<HtmlDocument> processer, int threads)
        {
            // Assign the rules to be used by the crawler
            // to validate urls and pages for crawling.
            _rules = rules;

            // Assign the processer the crawler will call to
            // have valid pages (specified by the rules) processed.
            _processer = processer;

            // At this point we start a thread for crawling.
            // The thread will block until urls are added to
            // the BlockingCollection.
            Task.Factory.StartNew(() => Crawl(threads), TaskCreationOptions.LongRunning);
        }
Exemplo n.º 2
0
 public CrawlersController(ICrawlerProcesser crawlerProcesser)
 {
     _crawlerProcesser = crawlerProcesser;
 }