python提取字典数字_python cookies提取——从字符串到字典(一行Python代码)
defextract_cookies(cookie):"""从浏览器或者requestheaders中拿到cookie字符串,提取为字典格式的cookies"""cookies=dict([l.split("=",1)forlincookie.split(";")])returncookiesif__name__=="__main__":cookie="continue=http://www.bj