This repository can download images from google with specified keywords or bare urls
- python 3.6
- selenium 3.6.0
- Firefox 55+
- geckodriver
Firefox and geckodriver are required by selenium, and Firefox 55 or greater is recommended, cause geckodriver support that best. As for geckodriver, just download the latest version of geckodriver from here, then add it to the PATH environment variable.
Here is an example of downloading with selenium using 2 processes
A few different methods are provided
other/download_with_urllib
- with just urllib, no dynamic js
- due to the limit by google, each searching query can download at most 100 images
- will directly download all the images since the number is small
download_with_keywords
- with Selenium, we can directly search and scroll in the browser, so we can get more than 100 images for each searching query.
- Specify
main_keywords
andsupplemented_keywords
in the code, eachmain_keyword
will join with eachsupplemented_keyword
to become a searching query, and one directory will be created for each main_keyword to store the related images. - will firstly store the actual links of images in a file, then download the actual images with the file
download_with_urls
- with Selenium, we can directly search and scroll in the browser, so we can get more than 100 images for each searching query.
- Specify
urls
in the code - will firstly store the actual links of images in a file, then download the actual images with the file
Most of the above methods support downloading with single process or multiple processes