抓取网页数据cookie获取
一、jsoup获取cookie
Map<String, String> cookies = null;
Response res = Jsoup.connect("http://www.baidu.com").timeout(30000).execute();
cookies = res.cookies();
二、Jsoup请求链接 携带cookie
Document doc = null;
doc = Jsoup.connect(url).cookies(cookies).timeout(30000).get();
网友评论