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

Popular posts from this blog

javascript - Create websocket without connecting -

how to do line continuation in perl debugger for entering raw multi-line text (EOT)? -

Android SDK Manager freezes after installation of OSX 10.11 El Capitan public Beta -