search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

1 answers
Q&A 如何读取通过cookielib.MozillaCookieJar()保存的cookies?

0

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!

Your Answer
submit

1 answers
0

我能读取cookie,试下:
cookie.load(cookie_file, ignore_discard=True, ignore_expires=True)

2016-11-09 14:18:30

submit

Popular tool

vc9-vc14 (32+64 bit) runtime library collection (link below)

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

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use