requests.exceptions.JSONDecodeError: Expecting value: line 3 column 1 (char 4)
时间: 2023-08-14 13:11:10 浏览: 159
引用\[1\]中的代码报错是因为在使用`res.json()`解析返回结果时,返回的数据不符合JSON格式,导致解析失败。解决方法是先打印`res.text`查看返回的数据内容,确认是否为完整的JSON数据。\[3\]根据引用\[3\]的解释,你可以通过打印`res.text`来查看返回的数据内容,看看是否完整的JSON数据。如果返回的数据不是完整的JSON格式,那么你需要检查请求的URL和参数是否正确,或者联系API提供方确认数据格式是否正确。
#### 引用[.reference_title]
- *1* [爬虫 res.json() 报错 requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)](https://blog.csdn.net/lyugd_dd/article/details/127053383)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [爬虫遇到“requests.exceptions.JSONDecodeError: Expecting value”错误](https://blog.csdn.net/m0_68503106/article/details/129851836)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)](https://blog.csdn.net/fei347795790/article/details/127615798)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文