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

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -