Commit cc18d863 authored by yihua.huang's avatar yihua.huang

sleep time

parent 42508af0
...@@ -30,13 +30,13 @@ public class HuabanProcessor implements PageProcessor { ...@@ -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"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment