Use existing IE cookie
keith at nekotaku.com
Thu Jul 30 17:58:56 CEST 2009
> What does you full example look like, including the
I ran them seperately, hoping for a clue as to what my "cookiejar"
The cookie-acquisition stuff returns "screener.ashx?v=151" when I
search with my domain I am interested in. I have tried
urllib2.HTTPCookieProcessor('screener.ashx?v=151') but that failed
with attr has no cookie header.
>From the HTTPCookieProcessor doco, it appears that non-IE browsers
have a cookie file (and example code) but from what I can tell IE uses
a hidden folder. (you can set your location in IE but it appends a
folder "\Temporary Internet Files" -
This example illustrates how to open a URL using your Netscape,
Mozilla, or Lynx cookies (assumes Unix/Netscape convention for
location of the cookies file):
import os, cookielib, urllib2
cj = cookielib.MozillaCookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
r = opener.open("http://example.com/")
Not sure how to adapt this for IE.
More information about the Python-list