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.4.tar.gz
(8.3 kB
view hashes)
Built Distribution
Close
Hashes for gi_scraper-0.4.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 140434d50c6279d08d2ad9b72525651d5f6d15edde22901525637d9d88a93c41 |
|
MD5 | ff31bc91287a7c2e3289cda91afecb66 |
|
BLAKE2b-256 | 43a36cda6cdb4dc72deea6eaa67d4fc2980633230d6ab4a1ec7e8b85302ea25f |