|
|
|
@ -6,6 +6,7 @@ import org.apache.http.HttpHost;
|
|
|
|
|
|
|
|
|
|
import us.codecraft.webmagic.proxy.Proxy;
|
|
|
|
|
import us.codecraft.webmagic.proxy.SimpleProxyPool;
|
|
|
|
|
import org.apache.http.auth.UsernamePasswordCredentials;
|
|
|
|
|
import us.codecraft.webmagic.proxy.ProxyPool;
|
|
|
|
|
import us.codecraft.webmagic.utils.UrlUtils;
|
|
|
|
|
|
|
|
|
@ -53,6 +54,8 @@ public class Site {
|
|
|
|
|
|
|
|
|
|
private HttpHost httpProxy;
|
|
|
|
|
|
|
|
|
|
private UsernamePasswordCredentials usernamePasswordCredentials; //代理用户名密码设置
|
|
|
|
|
|
|
|
|
|
private ProxyPool httpProxyPool;
|
|
|
|
|
|
|
|
|
|
private boolean useGzip = true;
|
|
|
|
@ -486,6 +489,15 @@ public class Site {
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public UsernamePasswordCredentials getUsernamePasswordCredentials() {
|
|
|
|
|
return usernamePasswordCredentials;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Site setUsernamePasswordCredentials(UsernamePasswordCredentials usernamePasswordCredentials) {
|
|
|
|
|
this.usernamePasswordCredentials = usernamePasswordCredentials;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ProxyPool getHttpProxyPool() {
|
|
|
|
|
return httpProxyPool;
|
|
|
|
|
}
|
|
|
|
|