FileCookieJar has not attribute "_self_load"

Dragos dragosmocrii at gmail.com
Sat Jan 17 10:30:09 CET 2009


On Jan 16, 9:19 pm, Dragos <dragosmoc... at gmail.com> wrote:
> I am trying to make a testing script to load/save cookies to a file
> with FileCookieJar, but it results in this error: FileCookieJar has
> not attribute "_self_load"
>
> This is my script:
>
> import urllib.request, urllib.parse,http.cookiejar
> url="http://localhost/test.php"
> cs=http.cookiejar.FileCookieJar()
> cs.load("cookies.txt",ignore_discard=False, ignore_expires=False)
> opener=urllib.request.build_opener(urllib.request.HTTPCookieProcessor
> (cs))
> y=opener.open(url)
> print(y.read())
>
> Thanks for helping.

BUMP



More information about the Python-list mailing list