result = response.json()出现错误json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
发表在Python视频课程答疑
2020-02-18
是否精华
是
否
版块置顶:
是
否
按基础教程视频打码,视频里面没有出现错误,我这里运行出现错误,需要如何解决,谢谢
result = response.json()出现错误json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
代码如下
import requests
url = response = requests.get(url) result = response.json() result = result[][] i result: (i) 错误如下 Traceback (most recent call last): File "D:/xueyuan/program/huochepiao/demo.py", line 5, in <module> result = response.json() File "D:\Program Files\Python\Python38\lib\site-packages\requests\models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "D:\Program Files\Python\Python38\lib\json\__init__.py", line 357, in loads return _default_decoder.decode(s) File "D:\Program Files\Python\Python38\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "D:\Program Files\Python\Python38\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) 进程已结束,退出代码 1
首页上一页 1 下一页尾页 3 条记录 1/1页