str ="""
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Cache-Control: no-cache
Connection: keep-alive
Content-Length: 150
Content-Type: application/x-www-form-urlencoded
Cookie: pgv_pvid=5289973183; __qc_wId=248; JSESSIONID=E6F956C723D0BE4ADDFDF45BFB28A15D; Hm_lvt_f2d726882e87f6b9f128f4e93000ff47=1539333316,1539334528,1539336615,1539336619; Hm_lpvt_f2d726882e87f6b9f128f4e93000ff47=1539336619
Host: login.zlbaba.com
Origin: https://login.zlbaba.com
Pragma: no-cache
Referer: https://login.zlbaba.com/login?service=https://www.patexplorer.com/login/cas
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36
"""
data = {}
# 请求头处理
for i in str.split('\n'):
if i:
data[i.split(':')[0].strip()] = i.split(':')[1].strip()
print(data)
# # 代理处理
# cookie = data['Cookie']
# cookies = 'UM_distinctid=1666726ac9d3bf-01ffab5f1d1987-541f3415-1fa400-1666726ac9e456; Hm_lvt_c9626224f562d87fd1862b3f365dcd00=1539330685,1539330702,1539331465,1539332073; CNZZDATA1261546263=61757800-1539324092-https%253A%252F%252Fwww.patexplorer.com%252F%7C1539329493; JSESSIONID=364987122632EE8630A802D0443A6EC6; yunsuo_session_verify=2546d202ec4ec197693b3a0626dc741e; PD=a0bf551aaa865492b3b7c974277516c3df9985758bf10e5ef8f541b24b358261aa21b08727f13d7f; Hm_lpvt_c9626224f562d87fd1862b3f365dcd00=1539332339'
# info = {}
# for i in cookies.split(';'):
# j = i.strip()
# if j:
# info[j.split('=')[0]] = j.split('=')[1]
# print(info)
复制谷歌请求头的简单处理
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...