What I'm trying to do here is to open values.json (which is https://www.rolimons.com/itemapi/itemdetails) but I get error on
values = json.load(file)
r = requests.get("https://www.rolimons.com/itemapi/itemdetails")
with open("values.json", "r ") as f:
f.write(r.text)
f.close()
file = open("values.json")
values = json.load(file)
CodePudding user response:
This seems to work:
import requests
import json
req = requests.get("https://www.rolimons.com/itemapi/itemdetails")
values = json.loads(req.content)
print(values)