首页上一页 1 下一页尾页 1 条记录 1/1页
result=response.json()为什么报错
发表在Python视频课程答疑
2020-04-27
是否精华
是
否
版块置顶:
是
否
import requests
url = 'https://kyfw.12306.cn/otn/leftTicket/query?leftTicketDTO.train_date=2020-04-27&leftTicketDTO.from_station=BJP&leftTicketDTO.to_station=SHH&purpose_codes=ADULT'
response = requests.get(url)
result = response.json()
result = result['data']['result'] # 信息在data文件下的result
for i in result:
print(i)
报错内容是:
发生异常: JSONDecodeError
Expecting value: line 1 column 1 (char 0)
File "E:\python_py\web_crawler\demo.py", line 5, in