I'm 99% sure this has already been answered, but I'm a serious newbie and need your gental kindness.
Below is JSON I get through an API call
{
name: "dt_listings",
count: 10,
results: {
collection1: [
{
title: {
text: "Human Anatomy and Physiology 10th",
href: "http://www.directtextbook.com/isbn/9780321927040"
},
isbn: {
text: "9780321927040",
href: "http://www.directtextbook.com/isbn/9780321927040"
}
} ]
import requests
import json
dt_raw = requests.get(dt_listings_url)
dt_json = dt_raw.json()
After this, is where my problems begin. I can't seem to go to ['results'] and then to ['collection1'] then ['title'] to get the values of ['title']['text'] nor ['isbn']['text']
Big request, if you use code sample to help, please use the names of the objects above so that i can follow (I'm having a serious brain freeze here!). And yes, i have read many stackoverflow posts related and I'm still having a hard time with this.
json.loadsto convert the returned JSON string to a dictionary and access it's fields ?collection1, you opened it with[but not closed it with]This is not a valid JSON. In addition, 2 more}missed