j = '{ "@context": "http://schema.org", "@type": "Product", "name":"Men\'s Slippers Brief Design Rivet Decor All Match Fashion Wearable Shoes", "image":"", "description": "Material:Faux Leather", "brand":{ "@type": "Thing", "name": "" }, "aggregateRating": { "@type": "AggregateRating", "ratingValue": "5", "reviewCount": "1" }, "offers": { "@type": "Offer", "availability": "http://schema.org/InStock", "price": "10.99", "priceCurrency": "USD" } }'
j = json.loads(j)
print(j['@context'])
print(j['aggregateRating']['reviewCount'])
print(j['aggregateRating']['ratingValue'])
print(j.keys())
print(j.values())
выход
http://schema.org
1
5
dict_keys(['@context', '@type', 'name', 'image', 'description', 'brand', 'aggregateRating', 'offers'])
dict_values(['http://schema.org', 'Product', "Men's Slippers Brief Design Rivet Decor All Match Fashion Wearable Shoes", '', 'Material:Faux Leather', {'@type': 'Thing', 'name': ''}, {'@type': 'AggregateRating', 'ratingValue': '5', 'reviewCount': '1'}, {'@type': 'Offer', 'availability': 'http://schema.org/InStock', 'price': '10.99', 'priceCurrency': 'USD'}])