public static void main(String[] args) throws IOException {
Map<String,String> header=new HashMap<>();
header.put("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
header.put("Accept-Language","zh-CN,zh;q=0.8");
header.put("Cache-Control","max-age=0");
header.put("Connection","keep-alive");
header.put("Host","www.xicidaili.com ");
header.put("If-None-Match","W/\"f9ed210d1bd9f787ddddffceef37c9bc\"");
header.put("User-Agent","Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 SE 2.X MetaSr 1.0");
header.put("Upgrade-Insecure-Requests","1");
String content=Jsoup.connect("https://www.xicidaili.com/wt/").referrer("https://www.xicidaili.com/wn")
.proxy("59.62.164.68", 9999)
.ignoreContentType(true)
.ignoreHttpErrors(true)
.headers(header)
.execute().parse()
.toString();
System.out.println(content);
}
请问我这个为啥一直报这个错误
Exception in thread "main" java.net.ConnectException: Connection refused: connect
代理ip我已经换了好几个 都是这样
代理ip来源:https://www.xicidaili.com
麻烦大佬解答一下 多谢