-
-
Save MikeeI/a1bec95f9ef9ee3b07fb to your computer and use it in GitHub Desktop.
Just the script
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
// 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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment