与jsoup建立url连接后,返回:
Please enable cookies</h2>
<p> This website is using a security service to protect itself from online attacks. The service requires full cookie support in order to view the website. </p>
<p>Please enable cookies on your browser and try again.</p>
在建立连接之前,我已经在获取cookies:
Connection.Response res = Jsoup.connect(url)
.method(Connection.Method.POST)
.timeout(30000)
.execute();
Map<String, String> cookies = res.cookies();
然后我把它传递给jsoup连接。
Document document = Jsoup.connect(url)
.cookies(cookies)
.ignoreHttpErrors(true)
.timeout(30000)
.get();
我做错什么了?
暂无答案!
目前还没有任何答案,快来回答吧!