Last active
December 11, 2015 09:18
-
-
Save arisolt/4578779 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 httprequest = require('request'), | |
cheerio = require('cheerio'), | |
async = require('async'), | |
array = []; | |
httprequest("http://google.com", function (error, response, body) { | |
var $ = cheerio.load(body); | |
var count = 0; | |
async.waterfall([function (callback) { | |
$('div').each(function(i, elem) { | |
count++; | |
}); | |
console.log(count); | |
callback(count); | |
}, function (count2, callback) { | |
console.log("SAY SOMETHING"); | |
}], function (err, results) {}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment