I am new to JSON in general and having no idea why this fails. My thoughts where that is has something to do with the double quotes.
This is the JSON String i want to load (printed with print(resultJson)):
"{"Paging":{"PageSize":20,"PageIndex":1,"TotalRecords":1},"Result":{"VerifyResult":1,"Data":[{"Id":"a2b6a53eb992b6a9e682f81450b39ce3","RegGov":"龙湖海关","TradeType":"进出口收发货人","RegDate":"2002-08-30"}]},"Status":"200","Message":"查询成功","OrderNumber":"..."}"
This is my code to do it:
# Get the Results:
print(response.status_code)
resultJson = json.dumps(str(response.content, encoding = encode))
# convert unicode to chinese
resultJson = resultJson.encode(encode).decode("unicode-escape")
print(resultJson)
print(json.loads(resultJson)["Result"])
This is the Exception:
File "C:\[...]\lib\json\decoder.py", line 340, in decode
raise JSONDecodeError("Extra data", s, end)
JSONDecodeError: Extra data
What do i need to change? I am i converting/decoding something wrong?