1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
function scrollDown(countOfPagesScrolled) { var initialHeight = document.body.clientHeight; var scrolledPages = 0; function scrollPage() { window.scrollTo(0, document.body.scrollHeight); scrolledPages++; if (scrolledPages < countOfPagesScrolled) { setTimeout(scrollPage, 2000); } else { sendRequest(); } } scrollPage(); } function sendRequest() { var inputs = document.querySelectorAll('.artdeco-button.artdeco-button--2.artdeco-button--secondary.ember-view.full-width'); inputs.forEach(function(input) { input.click(); }); } var countOfPagesScrolled = 5; scrollDown(countOfPagesScrolled); |