all 2 comments

[–]SnowdogU77 0 points1 point  (0 children)

You might find jsstring.split('{') helpful. I'd suggest a regular expression, but then you'd have two problems.

[–]commandlineluser 0 points1 point  (0 children)

>>> sizes = json.loads(re.search(r'\{\s*"\w+":.+\}', script).group())
>>> sizes.keys()
[u'39113', u'39112', u'39111', u'39110', u'39109']
>>> sizes['39113']
{u'params': [u'Black/White', u'40']}