Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

149
Views
Browser Autoscroll using console

I am trying to auto-scroll the webpage for [this link][1] for a custom date range. After scrolling, I have to save the full HTML of the page manually.

At first, I am choosing a custom range (example 1-7 July 2022), as shown below.

[![enter image description here][2]][2]

Now, I am trying to auto-scroll this page using Console. For this, I am using setInterval function like this way,

var button=document.getElementById("paginationShowMoreText");
myTimer = setInterval(function(){ 
        button.click();
     }, 1000);

Then after a minute clearInterval(myTimer); to terminate setInterval. After running this in console, I expect that it would show all analysis between custom range.But, unfortunately, it gives me the repetition of 1st page. How can I get the entire scrolled page so that I can download the page as source? Is there any other way to auto-scroll for a certain range of data, any kind of suggestion would be helpful for me.

Thanks for your kind attention.

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Try this

var button = document.getElementById("paginationShowMoreText");
setInterval(function(){ 
    button.click();
    window.scrollTo(0, document.body.scrollHeight);
 }, 1000);
about 4 years ago · Santiago Trujillo Report

0

The answer of Vivek is almost correct, but you need to re-query the button as its onclick attribute is changed after each click. (I've modified the query to make it a bit more precise: it fetches the anchor link instead of it's label)

So this should work as intended:

setInterval(function(){ 
    var button = document.querySelector('[data-action=listPaginationItems]');
    if (button) button.click();
    window.scrollTo(0, document.body.scrollHeight);
 }, 1000);
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!