Error 400 in urllib2 when using cookies
- by Hempage
I've had some success using a different method to load cookies, but now I'm wanting to use the cookielib.MozillaCookieJar method to open a cookies.txt file. Here's the snippet of code that does this.
cookieJar=MozillaCookieJar()
cookieJar.load(argv[2])
After creating an HTTPCookieProcessor opener, and installing it, whenever I use urlopen, I get an HTTP 400 error. However, if I don't use a CookieJar, the urlopen method succeeds (though the response doesn't contain the data I need).
I'm not sure whether the cookies.txt file is malformed, or whether there's something else going on.