Skip to content

Instantly share code, notes, and snippets.

@jeffgca
Created November 26, 2015 20:48
Show Gist options
  • Save jeffgca/157bb3e59bcf4e995253 to your computer and use it in GitHub Desktop.
Save jeffgca/157bb3e59bcf4e995253 to your computer and use it in GitHub Desktop.
Just the script
// once you're done, the collected global should have the entire list
var start = $$('.a-d .a-u').length;
console.log('starting at', start);
var goal = 10000;
var collected;
var max = window.scrollMaxY;
window.scrollBy(0, window.scrollMaxY);
// console.log(max)
var loop;
function scroll() {
loop = setInterval(function() {
window.scrollBy(0, window.scrollMaxY);
if (window.scrollMaxY > max) {
max = window.scrollMaxY;
} else {
clearInterval(loop);
console.log("length: ", $$('.a-d .a-u').length)
if ($$('.a-d .a-u').length < goal) {
$('.h-a-Hd-mb').click();
scroll();
}
else {
collected = $$('.a-d .a-u');
}
}
}, 2000);
}
scroll();
@MikeeI
Copy link

MikeeI commented Feb 1, 2016

Hi. Just curious, how can i execute this code. It this node.js code or do i pase this in to my browser console?
Greetings.

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