问题描述
当我使用以下在网上找到的代码以及创建者在pypi上显示的示例代码时,所有显示的内容是“很遗憾,由于无法下载某些图片,所有4个图片均无法下载。得到了这个搜索过滤器!”。对于下面的代码,该网站上的许多其他人都遇到了问题,但是我找不到任何修复程序或解释。我不确定为什么不下载,因为我把搜索词保留得很宽。
response = google_images_download.googleimagesdownload()
search_queries = ["kittens","kitten"]
def downloadimages(query):
arguments = {"keywords": query,"format": "jpg","limit":4,"print_urls":True,"size": "medium","aspect_ratio":"square"}
try:
response.download(arguments)
except FileNotFoundError:
arguments = {"keywords": query,"aspect_ratio":"square"}
try:
response.download(arguments)
except:
pass
for query in search_queries:
downloadimages(query)
print()
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)