[英]Download Images from google Image search not working
I'm trying to scrape images from google images using the google_images_download library by using it from another Python file.我正在尝试从另一个 Python 文件中使用 google_images_download 库从谷歌图像中抓取图像。 I previously used the code below about a month ago and it was fine but today morning it threw exception errors and then finally gave me the error
大约一个月前我以前使用过下面的代码,它很好,但今天早上它抛出异常错误,然后最终给了我错误
Unfortunately all 100 could not be downloaded because some images were not downloadable
不幸的是,由于某些图像无法下载,因此无法下载全部 100 张
I checked the documentation and GIT repo and noticed there were changes made 15 days ago, is there something I'm missing or is the library bugged?我检查了文档和 GIT 存储库并注意到 15 天前进行了更改,是我遗漏了什么还是库被窃听了? Also if there are better methods than this, kindly point me in the right direction.
另外,如果有比这更好的方法,请指出我正确的方向。 My code is below:
我的代码如下:
from google_images_download import google_images_download
response = google_images_download.googleimagesdownload()
arguments = {"keywords":"potato harvesting","limit":100,"format":"jpg","print_urls":True}
paths = response.download(arguments)
I figured a way to fix the error,through using the CLI instead of a Jupyter Notebook file.我想出了一种方法来修复错误,通过使用 CLI 而不是 Jupyter Notebook 文件。 I will list down the steps:
我将列出步骤:
python setup.py install
, I manually had to uninstall them, luckily I found python setup.py uninstall and the procedure is layed out there on how to manually uninstall (highest voted answer).python setup.py install
,我必须手动卸载它们,幸运的是我找到了 python setup.py 卸载程序,其中列出了如何手动卸载的过程(最高投票的答案)。:git clone https.//github.com/Joeclinton1/google-images-download.git
via the CLI and then opened the files by cd google-images-download
.:git clone https.//github.com/Joeclinton1/google-images-download.git
将 repo 再次克隆到一个新文件夹中,然后通过cd google-images-download
打开文件。pip install.
pip install.
NOT python setup.py install
.python setup.py install
。 This worked for me and hopefully will work for you.这对我有用,希望对你有用。 Note: I cloned the repo in a new folder on the desktop for ease.
注意:为方便起见,我将 repo 克隆到桌面上的一个新文件夹中。 The downloaded images will be in the same repo folder ie google-images-download under the Download file.
下载的图像将位于同一 repo 文件夹中,即下载文件下的 google-images-download。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.