Scrapy: saving cookies between invocations

久未见 提交于 2021-01-28 03:13:49

问题


Is there a way to preserve cookies between invocations of a scrapy crawler? The purpose - the site requires log in, and then maintains the session via cookies. I'd rather reuse the session than re-login every time.


回答1:


Please refer to the docs about cookies.

FAQ entry

CookiesMiddleware

Alternatively you can send Request objects with cookies managed by yourself (you can read cookies from Response objects' head).

About Request and Response objects



来源:https://stackoverflow.com/questions/31648903/scrapy-saving-cookies-between-invocations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!