An easy, robust, and straightforward web scraper with multifunctional uses.
npm install scrape-js
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());
});
});