def save_cookie():
cookie = cookielib.MozillaCookieJar('cookie.txt')
opener = urllib2.build_opener(HTTPCookieProcessor(cookie))
req = urllib2.Request(url=targeturl,headers=targetheaders)
opener.open(req)
cookie.save(ignore_discard=True,ignore_expires=True)我想通过cookielib.MozillaCookieJar('cookie.txt').load()来读取所保存的cookies,
但发现返回值是None!
1 answers
我能读取cookie,试下:
cookie.load(cookie_file, ignore_discard=True, ignore_expires=True)
Hot tools Tags
Hot Questions
Popular tool
vc9-vc14 (32+64 bit) runtime library collection (link below)
Download the collection of runtime libraries required for phpStudy installation
VC9 32-bit
VC9 32-bit phpstudy integrated installation environment runtime library
PHP programmer toolbox full version
Programmer Toolbox v1.0 PHP Integrated Environment
VC11 32-bit
VC11 32-bit phpstudy integrated installation environment runtime library
SublimeText3 Chinese version
Chinese version, very easy to use
Hot Topics
20416
7
13576
4






