网络爬虫-HTTP error fetching URL. Status=403

 org.jsoup.HttpStatusException: HTTP error fetching URL. Status=403, URL=http://xxxx.com/xxx/xxx/xxx.html (网络爬虫)

 
解决办法: 设置下userAgent,伪装成浏览器就可以了

Jsoup.connect("http://xxxx.com/xxx/xxx/xxx.html").userAgent("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31");

转载于:https://www.cnblogs.com/meonly/p/7151125.html

你可能感兴趣的:(网络爬虫-HTTP error fetching URL. Status=403)