import requests
url = 'https://news.163.com/special/cm_guonei/?callback=data_callback'
res = requests.get(url)
data_list = res.json()
print(data_list)
C:\Python\Python310\python.exe G:/djangoProject/demo.py
Traceback (most recent call last):
File "C:\Python\Python310\lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Python\Python310\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Python\Python310\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Python\Python310\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "G:\djangoProject\demo.py", line 5, in <module>
data_list = res.json()
File "C:\Python\Python310\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
上面是这样的报错结构
求大哥大姐们指教