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

151
Visualizações
JavaScript to click buttons automatically in a sequence in a different page

I am trying to auto click a button that redirects to a new URL, and from there click a button. Both buttons need to be clicked one after another; however, the latter executes as soon as the first starts executing. I need it to wait and then execute. Is this possible to achieve since both buttons are getting triggered from the different pages?

They are of both domains, I did use async and wait, but it still doesn't wait for the other link to load fully and then trigger the button. I want the first button to completely load the page and then trigger the next button.

basically, I am trying to follow users from another user's follower list. In the list, you have to visit first the follower's profile(first trigger) and then follow the use(second button). Is there a better approach to do this?

Code:

var draft = document.getElementsByClassName('follow__name');
        console.log(draft.length)
        console.log("draft = ", draft)
        draft[2].click(); //<-button number
        console.log(draft[2]) 
        document.getElementsByClassName('Button_label__3jCra')[5].click(); 
about 4 years ago · Juan Pablo Isaza
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