Google Image Scraper.
Project description
Google-Image-Scraper
About
This module is based on web-scraping technology and uses Google Images to provide a Streamable Image API.
Supported Systems
- Windows
Supported Browsers
- Chrome
How to Use?
# import Scraper class
from gi_scraper import Scraper
# The object creation has an overhead time
# The same object can be reused to fire multiple queries
sc = Scraper(headless=False)
for query, count in {"Naruto": 20, "Gintoki": 50, "Loki": 500}.items():
print("Querying...", query)
# scrape method returns a stream object
stream = sc.scrape(query, count)
# stream.get method yields Response object with following attributes
# - query (str): The query associated with the response.
# - name (str): The name attribute of the response.
# - src_name (str): The source name attribute of the response.
# - src_page (str): The source page attribute of the response.
# - thumbnail (str): The thumbnail attribute of the response.
# - image (str): The image attribute of the response.
# - width (int): The width attribute of the response.
# - height (int): The height attribute of the response.
for response in stream.get():
# response.to_dict returns python representable dictionary
print(response.image, response.to_dict())
# call this to terminate scraping (auto-called by destructor)
sc.terminate()
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.4.3.tar.gz
(8.3 kB
view hashes)
Built Distribution
Close
Hashes for gi_scraper-0.4.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60bf038d89ab551395faf7fbfe70ffaf60ec3c0d502fca6194de2fdb04431583 |
|
MD5 | 8d0cc375de479270c7fa1088f7842885 |
|
BLAKE2b-256 | 06d8cda5a1d86e79e88a827deeb3cd182e25e7bc0ffaabce4d068f627ccbd889 |