代码如下,错误
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
试过用urllib获取这个界面后用json.loads解析,一样的报错QAQ
import requests
url = 'http://changyan.itc.cn/v2/asset/scsUtil.js?v=20150826191'
page = requests.get(url).json()
代码如下,错误
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
试过用urllib获取这个界面后用json.loads解析,一样的报错QAQ
import requests
url = 'http://changyan.itc.cn/v2/asset/scsUtil.js?v=20150826191'
page = requests.get(url).json()
正确的请求获取响应的过程
import requests
url = "http://changyan.itc.cn/v2/asset/scsUtil.js?v=20150826191"
response = requests.get(url)
json_str = response.content.decode()
print(json_str)