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

264
Views
¿Cómo hago un clic div sin que se mueva el mouse?

Estoy tratando de hacer un código JavaScript que se inyecte en cpstest.org y cuando hace clic en el botón de inicio, automáticamente comienza a hacer clic automáticamente. Traté de hacer un guión para ello, pero simplemente no funcionó.

El botón de inicio tiene id de inicio pero no sé el elemento para hacer clic. Sería útil ver el código fuente o usar herramientas de desarrollo, pero están bloqueadas en mi computadora.

 let i = 1; document.querySelector('#start').addEventListener('click', function() { i = 0; }); function repeat() { if (i == 0) { document.querySelector(unknownId).click()}; requestAnimationFrame(repeat) } }; repeat();
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Aquí hay una solución:

 // speed - how many CPS you want // duration - how long the test is (in seconds) const rapidClick = (speed, duration) => { const startButton = document.querySelector('button#start'); const clickArea = document.querySelector('div#clickarea'); // Start the test startButton.click() // Click the clickArea on an interval based on the "speed" provided const interval = setInterval(() => clickArea.click(), 1e3 / speed); // Clear the interval after the duration has passed setTimeout(() => clearInterval(interval), duration * 1e3); } // Do 100 CPS for 5 seconds rapidClick(100, 5)

Noté que incluso al configurar el parámetro de speed en algo loco como 1000 CPS, la prueba dice solo 133-139 clics por segundo. Parece que termina en 139. Espero que esto ayude.

about 4 years ago · Santiago Gelvez 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!