这是我一直在尝试的代码:
import ijson
import urllib.request
with urllib.request.urlopen(some_link) as read_file:
path_array = ijson.items(read_file, object_in_json)但我知道这个错误:
(b'lexical error: invalid char in json text.\n \x1f\x8b\x08 (right here) ------^\n',)发布于 2022-08-02 15:24:13
该库可能不支持链接。
我建议您使用requests模块。所以,安装它,启动pip install requests。
然后,在您的.py文件中:
import requests
response = requests.get(url)
json = response.json()https://stackoverflow.com/questions/73209969
复制相似问题