爬虫四式——HttpClient

CircularRedirectException异常原因及解决办法

【解决办法】

HttpParams params = new BasicHttpParams(); 
HttpGet getMethod = new HttpGet("http://XXXX.XXX");
getMethod.getParams().setParameter("http.protocol.allow-circular-redirects", true);
HttpResponse response = httpClient.execute(getMethod);

参考:HttpClient的CircularRedirectException异常原因及解决办法

猜你喜欢

转载自blog.csdn.net/qq_28202661/article/details/107038293
今日推荐