Skip to content

Instantly share code, notes, and snippets.

@mariuz
Created August 3, 2012 14:06
Show Gist options
  • Save mariuz/3247959 to your computer and use it in GitHub Desktop.
Save mariuz/3247959 to your computer and use it in GitHub Desktop.
make a full picture of carmack tweets
var page = require('webpage').create();
page.open('http://twitter.com/ID_AA_Carmack', function (status) {
if (status !== 'success') {
console.log('Unable to access network');
} else {
var hitRockBottom = false;
while (!hitRockBottom) {
//scroll the page (not sure if this is the best way to do so...)
page.scrollPosition = { top: page.scrollPosition + 1000, left: 0 };
// Check if we've hit the bottom
hitRockBottom = page.evaluate(function() {
return document.querySelector(".has-more-items") === null;
});
}
page.render('output5.jpg')
var ua = page.evaluate(function () {
return document.getElementById('page-container').innerHTML;
});
console.log(ua);
}
phantom.exit();
});
@santosh-btc
Copy link

scrolling not working.can't get any output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment