--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.
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.
DL and unzip GoogleImagesDownloader -You can download it from here.
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
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