You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Override
public Site getSite() {
List httpProxyList = new ArrayList();
httpProxyList.add(new String[]{"127.0.0.1","8888"});
site.setHttpProxyPool(httpProxyList, true);
return site;
}
错误内容:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
at us.codecraft.webmagic.proxy.SimpleProxyPool.addProxy(SimpleProxyPool.java:159)
at us.codecraft.webmagic.proxy.SimpleProxyPool.(SimpleProxyPool.java:63)
at us.codecraft.webmagic.Site.setHttpProxyPool(Site.java:489)
at us.codecraft.webmagic.processor.example.BaiduBaikePageProcessor.getSite(BaiduBaikePageProcessor.java:39)
at us.codecraft.webmagic.Spider.(Spider.java:131)
at us.codecraft.webmagic.Spider.create(Spider.java:121)
at us.codecraft.webmagic.processor.example.BaiduBaikePageProcessor.main(BaiduBaikePageProcessor.java:45)
The text was updated successfully, but these errors were encountered:
site.setHttpProxyPool(httpProxyList, true)发生数组越界,代码:
错误内容:
The text was updated successfully, but these errors were encountered: