Skip to content

Instantly share code, notes, and snippets.

@relaxedtomato
Created May 1, 2015 16:31
Show Gist options
  • Save relaxedtomato/aad3168abe5a2e092b17 to your computer and use it in GitHub Desktop.
Save relaxedtomato/aad3168abe5a2e092b17 to your computer and use it in GitHub Desktop.
Using Cheerio with BlueBird
var request = require('request');
var cheerio = require('cheerio');
var bluebird = require('bluebird');
bluebird.promisifyAll(request);
var promise = request.getAsync('http://www.reddit.com');
promise.get(1).then(function (htmlbody) {
var $ = cheerio.load(htmlbody);
console.log($('.title').text());
});
reddit: the front page of the internet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment