sleep time
parent
42508af041
commit
cc18d863f3
|
@ -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"))
|
||||||
|
|
Loading…
Reference in New Issue