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

254
Views
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 answers
Answer question

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