Skip to main content

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(workers=4, headless=False)

stream = sc.get_stream()

for query, count in {"Naruto": 50, "Gintoki": 50}.items():

    # 'get_stream' method returns a generator 'stream'
    # The module expects 'stream' to be called immediately
    # after a query is fired and doesn't allow
    # chaining queries directly.

    sc.scrape(query, count, timeout=5)

    # A Response object is returned from the stream
    # It that the following attributes:
    # name - Image Name,
    # position - Image Index in Google Images,
    # sourceName - Source Website Name,
    # sourcePage - Source WebPage,
    # thumbnail - Image Thumbnail,
    # url - Image URL

    for response in stream():
        # call 'to_dict' method for a python dictionary representation
        print(response.to_dict())

Project details


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.2.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

gi_scraper-0.3.2-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page