import re
headers_str = '''
origin: https://sou.zhaopin.com
referer: https://sou.zhaopin.com/?p=3&jl=765&kw=python&kt=3
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: same-site
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36
'''
pattern = '^(.*?): (.*)$'
for line in headers_str.splitlines():
print(re.sub(pattern, ''\1': '\2',', line))
版权属于:
Lan
作品采用:
《
署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)
》许可协议授权
评论 (0)