Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib, json
- response = urllib.urlopen("http://reddit.com/.json")
- content = response.read()
- data = json.loads(content)
- import urllib.request, json
- response = urllib.request.urlopen("http://reddit.com/.json")
- content = response.read()
- data = json.loads(content)
- import urllib.request, json
- response = urllib.request.urlopen("http://reddit.com/.json")
- content = response.read()
- data = json.loads(content.decode("utf8"))
- >>> response.headers['content-type']
- 'application/json; charset=UTF-8'
Add Comment
Please, Sign In to add comment