Google Image Scraper - A package that allows to fetch image urls and download images from google images.
Project description
Google-Image-Scraper
About
Image scraping is required many a times for web-based and machine learning projects. This module will help in fetching or downloading images from google.
Supported Systems
- Windows
Supported Browsers
- Chrome
How to Use?
This module is to be used along with chromedriver. Download correct version of chromedriver from here:-
Link - https://chromedriver.chromium.org/downloads
# import Scraper class
from gi_scraper import Scraper
# important since the library implements multiprocessing
if __name__ == "__main__":
# creating Scraper object
scraper = Scraper(process_count=4)
for query in ["Naruto", "Gintoki", "Luffy", "Goku"]:
# use scrape method to fire queries - returns ScrapedResponse object
scraped_response = scraper.scrape(query, count, quality, progressbar, timeout)
# default values
# process_count=1
# count=50
# quality=False (works only for process_count=1)
# progressbar=True
# timeout=10 (in seconds)
# setting process_count > 1 will change quality to True for every call to scrape method
# dealing with ScrapedResponse object
# write and download methods can be chained
# writes to a json file
# downloads .jpg images
scraped_response.write(path="./", filename="query").download(path="./", thread_count=1)
# get returns a dictionary with metadata and list of scraped urls
# can be chained only at the end of the chained methods (write and download)
scraped_response.get()
# call close method or (del scraper) once scraping is done
# needed for avoiding program going into an infinite loop
scraper.close()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gi_scraper-0.3.0.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for gi_scraper-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b91d38e804121d0cfe79133f0efc3e3dea6d8df89afde2e20fee3a8559f14c8 |
|
MD5 | 9f3aeca24e65e7bb00f92030fea6d91a |
|
BLAKE2b-256 | 8a0350572e87768ad6ae2f5e4463385ff507bcf2235f22e6ad9821c6a7a539ed |