[PYTHON] Record of actions to be taken when google_image_download cannot be used

Content of this article

--google_image_download didn't work, so a memo of how to deal with it myself -I tried to download the image of the teacher data by referring to this article, but google_image_download did not work. ――After all, there was a modified version on Github, so I told you that it worked when I downloaded it. ――It's almost a Japanese translation of what is written on the page where the above modified version is located.

environment

Workaround

  1. If you don't have Firefox and geckodriver, install --Geckodriver can jump to the distribution page from here. --Geckodriver puts the path of the user variable. --If you don't know, refer to Here. -(For reference) In the system environment variable, describe the path to the geckodriver folder that was moved to the Firefox installation folder after decompression.

  2. DL and unzip GoogleImagesDownloader -You can download it from here.

  3. Use the program you want to use from the decompression folder. --I run download_with_selenium.py --You can collect images with your favorite words by rewriting the keywords per 190 lines of the program. --If you get a user_agent error, install the module with pip and it will work. -This module. --I installed the module with the following code. - pip install user_agent

  4. If all goes well, Firefox will start up as soon as the program is executed, and a folder with the name of the search word will be created in the current directory and downloaded. ――It seems that you first get the URLs in bulk and then actually download the images. ――So, even if you look at the folder, you will be worried that there will be no images at first. ――If you wait, the image will be downloaded.

Recommended Posts

Record of actions to be taken when google_image_download cannot be used
Measures to be taken when "Cannot open display" is displayed in X11 Forward
[android] When AVD cannot be used with permission denied
Service cannot be started due to accumulation of semaphores
Measures to be taken when garbled characters when trying to redirect / pipe the result of aws-cli
[Small story] How to install the module when pip cannot be used due to proxy etc.
When Times New Roman cannot be used with matplotlib (Ubuntu)
When USB cannot be formatted
When pydub cannot be installed
[For IT beginners] What to do when the rev command cannot be used with Git Bash
What to do when a video cannot be read by cv2.VideoCapture
Measures to be taken when Suspicious Operation occurs in HttpResponse Redirect
Things to be aware of when building a recommender system using Item2Vec
The story of using mysqlclient because PyMySQL cannot be used with Django 2.2
I tried to put PyCharm in Ubuntu 16.04 LTS (PPA cannot be used)
[Python3] Code that can be used when you want to change the extension of an image at once
Be careful when adding an array to an array
Summary of scikit-learn data sources that can be used when writing analysis articles
[Ubuntu 18.04 LTS] What to do when the screen resolution cannot be selected [NVIDIA]
Correspondence memo when the direction key cannot be used on the python command line