Python使用已存储的Cookie请求页面
天蓬老师
天蓬老师 2017-04-17 13:27:39
0
2
310

如图所示的Cookie,加载后一下再访问,
我使用了这样的代码

ck = cookielib.MozillaCookieJar()
ck.load(os.path.join('/home/kslr/xunlei-lixian-master', 'xun.cookie'))

报错:
does not look like a Netscape format cookies file

这个cookielib的使用我不是很清楚,找到的资料也很模糊,请帮我指点一下。

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(2)
巴扎黑

There is the word LWP in

, so you should use LWPCookieJar. Only those with Netscape should use MozillaCookieJar.

PHPzhong

The Session of Requests is quite good, you can give it a try.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!