0.0.0 • Published 10 years ago

scrape-js v0.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
10 years ago

scrape-js

An easy, robust, and straightforward web scraper with multifunctional uses.

Installation

npm install scrape-js

Example

The following code scrapes the Hacker News website and prints the first 30 titles found on the page.

var scrape = require('scrape-js')
scrape('news.ycombinator.com', ['.title a'], function (error, titles) {
    if(error) throw error;
    console.log('hacker news titles\n');
    titles.forEach(function (element, idx) {
        console.log('  %d. %s', idx+1, element.html());
    });
});