Skip to content

Instantly share code, notes, and snippets.

@lihongjie0209
Created April 11, 2018 02:07
Show Gist options
  • Save lihongjie0209/ab6fcbfafbfd04005ec66529f55ad16f to your computer and use it in GitHub Desktop.
Save lihongjie0209/ab6fcbfafbfd04005ec66529f55ad16f to your computer and use it in GitHub Desktop.
In [57]: from http.cookies import SimpleCookie
In [58]: s = SimpleCookie('''bid=hZdgjLJMNv4; _vwo_uuid_v2=AD40AA237919D79C67460DEFD37AFAA4|65f61f85190c51b2
...: cfa95d3910cc2914; gr_user_id=2d7956ee-7cd2-4fad-8a7d-d0b2265ceeba; ll="118316"; _pk_ref.100001.4cf6
...: =%5B%22%22%2C%22%22%2C1489750475%2C%22https%3A%2F%2Fwww.google.com.hk%2F%22%5D; ap=1; _pk_id.100001
...: .4cf6=270eb4959a2a2414.1489750475.1.1489750559.1489750475.; _pk_ses.100001.4cf6=*; __utma=30149280.
...: 1851478845.1488968861.1489658025.1489750475.5; __utmb=30149280.0.10.1489750475; __utmc=30149280; __
...: utmz=30149280.1489750475.5.5.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided);
...: __utma=223695111.721177542.1489750475.1489750475.1489750475.1; __utmb=223695111.0.10.1489750475; _
...: _utmc=223695111; __utmz=223695111.1489750475.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmc
...: tr=(not%20provided)''')
In [59]: {v.key:v.value for k,v in s.items()}
{'__utma': '223695111.721177542.1489750475.1489750475.1489750475.1',
'__utmb': '223695111.0.10.1489750475',
'__utmc': '223695111',
'__utmz': '223695111.1489750475.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)',
'_pk_id.100001.4cf6': '270eb4959a2a2414.1489750475.1.1489750559.1489750475.',
'_pk_ref.100001.4cf6': '%5B%22%22%2C%22%22%2C1489750475%2C%22https%3A%2F%2Fwww.google.com.hk%2F%22%5D',
'_pk_ses.100001.4cf6': '*',
'_vwo_uuid_v2': 'AD40AA237919D79C67460DEFD37AFAA4|65f61f85190c51b2cfa95d3910cc2914',
'ap': '1',
'bid': 'hZdgjLJMNv4',
'gr_user_id': '2d7956ee-7cd2-4fad-8a7d-d0b2265ceeba',
'll': '118316'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment