Jsoup 设置代理IP

设置代理IP 设置完成后可发送抓取数据的请求

System.setProperty("http.maxRedirects", "50");
System.getProperties().setProperty("proxySet", "true");
// 如果不设置,只要代理IP和代理端口正确,此项不设置也可以
String ip = "11.184.192.49";
System.getProperties().setProperty("http.proxyHost", ip);
System.getProperties().setProperty("http.proxyPort", "80");

免费的IP: http://www.xici.net.co/

 

posted @ 2015-04-17 13:22  CodingTom  阅读(12096)  评论(1)    收藏  举报