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

146
Views
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
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!