I have a URL which gives a JSON result. I can parse the json and print the data from the JSON. But my main intention is to group each content and print them into an Excel sheet.
The code I wrote is:
import json
import urllib2
url = urllib2.urlopen("urlquery")
data = json.load(url)
print data
The data is printed in the dict
type. Here each content has at least 10 parameters like ID
, Name
, Rating
, Genre
, Poster
, etc.
How can I group each content with all the parameters? I am stuck here but from the group I know how to print into an Excel sheet.
Sample JSON response is below:
{
facets: { },
contents: [
{
id: "groupid://7110070",
type: "group",
adult: false,
source: "group",
instanceId: "groupid://7110070",
parentalRating: {
scheme: "custom",
rating: 0
},
I can't show the entire file due to security concerns.