Ichi
Posted on February 22, 2021
Around August 2020, the method of providing results in Google search seems to have changed significantly, and the Windows software "ImageSpider" can no longer be used. (It was quite convenient, though ...)
So from now on, I decided to use the Python library "google_images_download".
Installation
[Caution] Do not install with pip!
The version in PIP does not support changes on the Google side, so it cannot be used even if it is installed.
So install it directly.
git clone https://github.com/Joeclinton1/google-images-download.git
cd google-images-download && sudo python setup.py install
This completes the installation.
How to use
Here, as a typical usage, the usage method on the command line is listed.
googleimagesdownload --keywords "apple" --limit 20
In the above example, 20 search results for "apple" will be saved in the current directory.
Please see official document for how to use it on Python and other condition settings.
When acquiring 100 or more
If you want to get more than 100 images, you need to install chrome driver.
- This is the operation method for Ubuntu 20.04 LTS. For Windows, please check by yourself m (_ _) m
First check the latest version of the driver
Please go to the following site and copy the latest version of "chromedriver_linux64.zip" URl.
- https://sites.google.com/a/chromium.org/chromedriver/downloads By the way, as of January 6, 2021, it was https://chromedriver.storage.googleapis.com/88.0.4324.27/chromedriver_linux64.zip.
Then enter the following command in succession. (I referred to this article.)
sudo apt install unzip
cd /tmp/
curl -O <<<<<Enter the URL you just confirmed here>>>>>
unzip chromedriver_linux64.zip
mv chromedriver /usr/local/bin/
rm chromedriver_linux64.zip
This completes the installation.
Command to get 100 or more
googleimagesdownload --keywords "apple" --limit 120 --chromedriver /usr/local/bin/chromedriver
Just select the installation destination with the --chromedriver option for the one I introduced earlier.
You have obtained it properly.
I've written a lot, so please take a look at my blog.
Posted on February 22, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.