Parsing Through Nested JSON Python
问题 data = response.json() sortJson = json.dumps(data, sort_keys=True, indent=2, separators=(',', ':')) result = json.loads (data) print ('"saleTotal":', result['trips']['tripOption']['pricing']['saleTotal']) This is the code I have currently. I'm looking to parse through a nested JSON file, but each time I run this I get the following error: TypeError: the JSON object must be str, not 'dict' The JSON file when Pretty Printed turns out like this: { "kind":"qpxExpress#tripsSearch", "trips":{ "data