sleep time

master
yihua.huang 2013-07-26 16:34:09 +08:00
parent 42508af041
commit cc18d863f3
1 changed files with 2 additions and 2 deletions

View File

@ -30,13 +30,13 @@ public class HuabanProcessor implements PageProcessor {
@Override @Override
public Site getSite() { public Site getSite() {
if (site == null) { if (site == null) {
site = Site.me().setDomain("huaban.com").addStartUrl("http://huaban.com/"); site = Site.me().setDomain("huaban.com").addStartUrl("http://huaban.com/").setSleepTime(1000);
} }
return site; return site;
} }
public static void main(String[] args) { public static void main(String[] args) {
Spider.create(new HuabanProcessor()) Spider.create(new HuabanProcessor()).thread(5)
.scheduler(new RedisScheduler("localhost")) .scheduler(new RedisScheduler("localhost"))
.pipeline(new FilePipeline("/data/webmagic/test/")) .pipeline(new FilePipeline("/data/webmagic/test/"))
.downloader(new SeleniumDownloader("/Users/yihua/Downloads/chromedriver")) .downloader(new SeleniumDownloader("/Users/yihua/Downloads/chromedriver"))