Jsoup catch data appear unknowhost exception ,and can`t ping the website ,but my web browser can visit
I try change the userAgent,but it doesn`t work! Here are the userAgent before:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
Here the my browser userAgent which can visit:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36
Although I change the userAgent,but it remains the unknowhost exception !
Here is my code:
doc = Jsoup.connect(source+"/blacklist/"+y+"_m0_p"+p) //
.userAgent("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36") //
.timeout(5000 * tryCount) //
.get();
Check if your browser uses a proxy. If so, tell Jsoup to use the same proxy: