zhegexiaohuozi / SeimiCrawler

一个简单、敏捷、分布式的支持SpringBoot的Java爬虫框架;An agile, distributed crawler framework.
http://seimicrawler.org
Apache License 2.0
1.98k stars 681 forks source link

Invalid cookie header: "Set-Cookie: #49

Open lt82654993 opened 5 years ago

lt82654993 commented 5 years ago

问题: CookieStore cookieStore = httpClient.getCookieStore(); 这种形式获取cookie可能会导致cookie信息获取不全,报invalid cookie header httpclient警告提 示; 提示信息如下 o.a.h.c.protocol.ResponseProcessCookies : Invalid cookie header: "Set-Cookie: activityAccountJumpPage=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; domain=kuaishou.com". Invalid 'expires' attribute: Thu, 01 Jan 1970 00:00:00 GMT

解决方法: Response response = httpClient.execute(httpPost); response.getHeaders("Set-Cookie")[0].getValue();