This is my code below:
from urllib.request import urlopen
import json
import requests
url = 'https://production-us-adidasgroup.demandware.net/s/adidas-US/dw/shop/v15_6/products/(CQ1862)?client_id=392f521c-cf82-4c24-8ee4-97b4bfe926c5&expand=availability,variations,prices&callback=jQuery311046436681352330944_1508679685699&_=1508679685720.json'
s = requests.session()
res = s.get(url)
json_dict = res.json()
qty = json_dict['inventory']['ats']
print(qty)
I am trying to parse the 'ats' from the url, but keep running into error:
simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I think it's because in the URL the first line doesn't have value. Is there any way to skip this? I know I'm not using some of the modules I have imported.