Skip to content

Instantly share code, notes, and snippets.

@arisolt
Last active December 11, 2015 09:18
Show Gist options
  • Save arisolt/4578779 to your computer and use it in GitHub Desktop.
Save arisolt/4578779 to your computer and use it in GitHub Desktop.
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