I am trying to get the cookies from the request using this line of code but got []
empty result
response.headers.getList('Set-Cookie')
and this
response.request.headers.get('Cookie')
when I open_in_browser
the response I inspect the Network tab and see the cookies exist (See image below)
Any Idea? Thank you
response.headers.getlist("Set-Cookie")
works for me (Scrapy 1.4.0)
But first, check in shell if you actually have received this cookie:
scrapy shell
fetch('your_url')
response.headers.getlist("Set-Cookie")
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.