Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Node.js module for scraping images from the web.
branch: master

Merge pull request #2 from rv-kip/master

Add 'end' event + make jslinter stop complaining
latest commit b34c09312d
@leon-vv authored

Node Image Scraper

Scrape images from the web easily.


The image-scrape module provides a class which needs to be constructed with a url:

var Scraper = require("image-scraper");

var scraper = new Scraper("");

The url can be changed easily:

scraper.address = "";

The scraper object provides the .scrape() method. The scrape method accepts one optional argument: a callback function.

This callback function can also be set using the .on() method.

scraper.on("image", function(image){

    // Do something.    

The callback is called every time an image tag has been found, the image object which is passed in consist of the following:

// The attributes found in the image tag, which is parsed by [cheerio](
// The basename of the image.;
// Absolute path to the folder the image will be saved to.
// Extension of the image file.
// The absolute URL of the image.
// The URL of the page the image is scraped from.
// Save the image.;

The default behaviour is to save the image in the current directory, with the name and extension found in the src attribute.

Something went wrong with that request. Please try again.