0.0.2 • Published 10 years ago
session-scraper v0.0.2
Session Scraper
A super simple web scraper that mimicks a browsing session by saving cookies and refering URL from previous requests.
Install
$ npm install session-scraper
Usage
var Scraper = require('session-scraper');
var scraper = new Scraper();
scraper.get('https://github.com/roryf?tab=repositories').then(function($) {
var repoUrl = $('.repolist li:first-child h3 a').attr('href');
var name = $('.repolist li:first-child h3 a').text();
console.log('Fetching readme for ' + name);
scraper.get('http://github.com' + repoUrl).then(function($) {
console.log($('.entry-content').text());
});
});