cookies_str = "device=web; device_used=web;"
cookies_dict = {i.split('=')[0]: i.split('=')[1] for i in cookies_str.split('; ')}
print(cookies_dict) # {'device': 'web', 'device_used': 'web;'}
cookies_str = "device=web; device_used=web;"
cookies_dict = {i.split('=')[0]: i.split('=')[1] for i in cookies_str.split('; ')}
print(cookies_dict) # {'device': 'web', 'device_used': 'web;'}
本文标题:格式化cookies
本文链接:https://www.haomeiwen.com/subject/dfljiqtx.html
网友评论