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.1.tar.gz
(7.9 kB
view hashes)
Built Distribution
Close
Hashes for gi_scraper-0.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c091cbe62749dd52179749a9288d98f6394761d49baa86818d0ead2e609e09fe |
|
MD5 | 01010e78a6a237b824edf409fc07e7af |
|
BLAKE2b-256 | 945c8bf3d5d5999b82f27f895a84f017fa84ab38f1f2832446fb45bb8202750b |