Created
May 1, 2015 16:31
-
-
Save relaxedtomato/aad3168abe5a2e092b17 to your computer and use it in GitHub Desktop.
Using Cheerio with BlueBird
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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