Skip to content

Harkame/google-images-downloader

Repository files navigation

google-images-downloader

PyPI version Test

Codacy Badge Maintainability CodeFactor

Coverage Status codecov

License: GPL v3

Requirements

OR

Installation

pip install google-images-downloader

OR

git clone https://github.com/Harkame/google-images-downloader.git

cd GoogleImagesDownloader

pip install .

Usage

Command line

Basic usage

google-images-downloader -q QUERY1 QUERY2 "LONG QUERY 3"

For more informations

google-images-downloader -h

Programmatically

from google_images_downloader import GoogleImagesDownloader

downloader = GoogleImagesDownloader(browser="chrome", show=False, debug=False,
                                    quiet=False, disable_safeui=False)  # Constructor with default values

downloader.download("bear")  # Download 50 images in ./downloads folder

downloader.download("cat", destination="C:\download\destination")  # Download at specified destination

downloader.download("bird", limit=200)  # Download 200 images

downloader.download("dog", resize=(256, 256))  # Download with images resizing

downloader.download("fish", file_format="JPEG")  # Download with images re-formatting (JPEG or PNG)

downloader.close()  # Do not forget to close the driver

Specify browser to use for web scraping

from google_images_downloader import GoogleImagesDownloader

downloader = GoogleImagesDownloader(browser="firefox")  # Default : "chrome"

...

downloader.close()  # Do not forget to close the driver

Increase webdriver wait duration

from google_images_downloader import GoogleImagesDownloader, set_webdriver_wait_duration

downloader = GoogleImagesDownloader()

set_webdriver_wait_duration(60)  # Wait 60s maximum, default 30

...

downloader.close()  # Do not forget to close the driver

Tests

pip install pytest

pytest google_images_downloader/tests

About

Script to download images from Google Images queries

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published