标签:
public static void main(String[] args) throws IOException { Connection.Response res = Jsoup.connect("http://***.com/authorize") .data("u", "123456789@123.com", "pwd", "****","k","y","op","l").ignoreContentType(true) .method(Method.POST) .execute(); Document doc = res.parse(); System.out.println(doc); //这儿的SESSIONID需要根据要登录的目标网站设置的session Cookie名字而定 Map<String, String> map = res.cookies(); Set<Entry<String, String>> entries = map.entrySet(); Connection connection = Jsoup.connect("http://***.com/inbox"); for(Entry<String, String> entry:entries){ connection.cookie(entry.getKey(), entry.getValue()); } Document objectDoc = connection.get(); System.out.println(objectDoc); }
标签:
原文地址:http://blog.csdn.net/hackcoder/article/details/43065897