Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

262
Vistas
How can I run javascript like a batch file?

How can I run javascript like a batch file?

I want to run the script below at midnight every day.

However, if you do a command in window.location.href, all subsequent JavaScript commands are ignored.

I want to register and run the task scheduler in Windows environment, but is there any possible way?

async function init() {
   window.location.href = 'url where I want to go';
     await timer(3000);
}

init().then(e => {

window.alert = function() {};

const lists = document.querySelectorAll('.List > div.board-list > div.list > table > tbody > tr');


const timer = ms => new Promise(res => setTimeout(res, ms))

async function load() {
for (let list of lists) {
     console.log(list);
    list.querySelector('td.list-btn > a.btn.btn-primary').click();
     await timer(3000);
   }
}
});

Best Regards!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

To control a website, it needs to be loaded by a webbrowser. (for example Puppeteer, like Diego pointed out) You can find examples here. To execute the code once a day you can either use cron to call your file or use a package like Node schedule. With the secound solution the file needs to run already

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda