mechanize - Using a python menchanize response as a dict -
when open link mechanize:
r = br.open(url) print(r.read())   the returned results like:
[{"name":"name","year":"2000","link":"link"}]   how can convert response dict can access later. thx in advance.
load json module:
import json   data = json.load(r)     note don't need call read() explicitly, load() you.
Comments
Post a Comment