Created
January 19, 2013 21:54
-
-
Save geNAZt/4575430 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'); | |
var page = 1; | |
var maxPage = 50; | |
function performAfterLoadAttempt(error, response, body) { | |
"use strict"; | |
//Log the Body | |
console.log(body); | |
//Next Page | |
page++; | |
//Only request more pages if there is a page you want to get | |
if (maxPage > page) { | |
httprequest("http://www.google.com/?p=" + page, performAfterLoadAttempt); | |
} | |
} | |
//Request the first page | |
httprequest("http://www.google.com/?p=" + page, performAfterLoadAttempt); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment