If the URL is returning valid JSON-encoded data, use the json
library to decode that:
import urllib2
import json
response = urllib2.urlopen('https://api.instagram.com/v1/tags/pizza/media/XXXXXX')
data = json.load(response)
print data
More Related Contents:
- Python Requests: Post JSON and file in single request
- urllib2 and json
- How to read a single object from a json file containing multiple objects using python? [closed]
- Split / Explode a column of dictionaries into separate columns with pandas
- How do I write JSON data to a file?
- Import error: No module name urllib2
- How to get string objects instead of Unicode from JSON?
- Single vs double quotes in JSON
- Reading rather large JSON files [duplicate]
- How to JSON serialize sets?
- json.dumps vs flask.jsonify
- Python read JSON file and modify
- Django REST Framework POST nested objects
- Handling urllib2’s timeout? – Python
- Python urllib2.urlopen() is slow, need a better way to read several urls
- flattening nested Json in pandas data frame
- Python: Trying to Deserialize Multiple JSON objects in a file with each object spanning multiple but consistently spaced number of lines
- How to convert to a Python datetime object with JSON.loads?
- Cast Flask form value to int
- Check if key exists and iterate the JSON array using Python
- Serialising an Enum member to JSON
- urllib2.URLError:
- Requests, bind to an ip
- Python JSON TypeError list indices must be integers or slices, not str
- How to customise error response in FastAPI?
- Accessing dictionary by key in Django template
- Can json.loads ignore trailing commas?
- Limiting number of processes in multiprocessing python
- Rendering JSON objects using a Django template after an Ajax call
- Single versus double quotes in json loads in Python