Giter Club home page Giter Club logo

webimagescraper's Introduction

WebImageScraper

Scrape images from Google Images

Dependencies:

Depends on Requests and BeautifulSoup Libraries

Usage:

Download images (upto 100 currently). To use this, download the scraper.py and run,

python3 scraper.py

Arguments:

-s - (s)earch term.

-c - Include this flag to (c)ache the search query. The searches are cached using a simple pickle file at the location of scraper.py within a subfolder /caches with the same filename as that of the search query and an extension .cache. The pickle file is a simple list of urls.

-p - If you wish to download from a pre-existing cache file, include the (p)ath of the cache file after this argument.

-d - Choose the location to (d)ownload the files. A downloads folder is created at the location and the image files are stored in a subdirectory with the name of the search term.

-v - (V)erbose mode to see the intermediate steps

Class:

The implementation is in a class. The class downloader is initialized with the following:

  1. search_term - The term to search for
  2. verbose_mode - Verbose mode status

The Methods provided involve:

  1. get_urls - Takes cache status as a parameter. Obtains the image urls into downloadurls.
  2. printprogress - Print the progess of the download. Takes the current number of the file being downloaded as a parameter
  3. download - Downloads the images into the location specified by the download_location parameter
  4. load_from_cache - Load the download urls from the cache file into downloadurls.

Todo:

  • Auto search the cache first for a cache file. Access Google Images only upon a cache miss
  • Parallelize the downloads in threads
  • Increase downloaded image count per run (currently 100)

webimagescraper's People

Contributors

mmshivesh avatar

Stargazers

 avatar

Forkers

bluocan

webimagescraper's Issues

download limit

is there a line where the download limit is set, I need a limit of 1000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.