发布时间:2019-09-17 07:48:15编辑:auto阅读(1789)
1、独立cookie。(两个打印结果应该不同)
#coding=utf-8 import grequests urls = [ 'http://www.baidu.com/', 'http://www.zhihu.com/', ] rs = [grequests.get(url) for url in urls] grequests.map(rs) for ar in rs: print(ar.session.cookies)
2、共享cookie。(三个打印结果应该相同)
#coding=utf-8 import grequests import requests urls = [ 'http://www.baidu.com/', 'http://www.zhihu.com/', ] sn = requests.Session() rs = [grequests.get(url, session = sn) for url in urls] grequests.map(rs) for ar in rs: print(ar.session.cookies) print(sn.cookies)
相关阅读:grequests pypi
*** walker ***
上一篇: python和shell的ping对比
下一篇: python 练习题之【数字排序】
47840
46389
37280
34731
29312
25971
24909
19950
19542
18030
5791°
6411°
5926°
5961°
7063°
5911°
5942°
6437°
6404°
7777°