I am using The Guardian's API to get JSON data and now I want a specific element from the JSON data entry. How do I do that?
I am making the following GET request
url = 'http://content.guardianapis.com/search?from-date=2016-01-02&to-date=2016-01-02&order-by=newest&show-fields=all&page-size=1&api-key=API-KEY.
And now I want webTitle from the JSON data. So I am doing as follows:
response = requests.get(url)
response = response.content
response = json.loads(response)
content = response['response']['results']['webTitle']
But I am getting TypeError: string indices must be integers, not str error.
However, content = response['response']['results']works correctly.
