I want to click all the buttons at a website but my code tries to click all 2000 buttons at the same time and because of that chrome fails. How can I make it click one by one to the all buttons so it won’t force the computer and chrome? I’ve thinked to count the index of the elements and have a for loop but I wonder is there any other ways or a basic code
const divs =
document.querySelectorAll('.wbloks_1');
divs.forEach(div => {
div.click();
});
Chrome failed because of the overload
2
Answers
You can use recursion for the task
In case you haven’t figured this out yet, and as I mentioned in my comment you could use
setTimeout
for this.