python - No cookies using requests library -
i'm trying out requests python. although i'm unsure cookies. code i'm using simple this.
dn = requests.get('http://www.dn.se') print dn.cookies <<class 'requests.cookies.requestscookiejar'>[]> no cookies. when check in browser lot of cookies website.
that page sets no cookies itself:
$ curl -d - -o /dev/null http://www.dn.se % total % received % xferd average speed time time time current dload upload total spent left speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0http/1.1 200 ok content-type: text/html; charset=utf-8 server: microsoft-iis/7.5 x-powered-by: asp.net cache-control: public, max-age=49 date: thu, 18 jul 2013 15:09:37 gmt transfer-encoding: chunked connection: keep-alive connection: transfer-encoding expires: tue, 01 january 2013 01:00:00 gmt 100 511k 0 511k 0 0 1664k 0 --:--:-- --:--:-- --:--:-- 1809k no set-cookie header set. page load other resources, browser sends additional requests images, javascript , css, each of include set-cookie header in response. javascript calls set cookies too.
modern browsers let inspect response headers of resources loaded webpage. set-cookie headers in responses.
Comments
Post a Comment