Beispiel #1
0
        public void RunTest_Success()
        {
            var site = new Site {
                ThreadCount = 30
            };
            var pageProcessor = new DefaultPageProcessor();
            var htmlPiepline  = new HtmlFilePiepline();
            var filePiepline  = new FilePipeline();
            var listening     = new ConsoleSpiderListening();
            var spider        = new Spider(site, pageProcessor);

            spider.AddSeedUrl("http://sh.lianjia.com/")
            .AddPiepline(htmlPiepline)
            .AddPiepline(filePiepline)
            .AddListening(listening)
            .Run();
        }