Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

153
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda