1
I have the following code, which tries to click a button after 60 seconds, and if it has not pressed, try again after 60 seconds.
while(true) {
var timeout = setTimeout(function() {
try{
document.querySelector('.department-info').click()
} catch(e) {
console.log('Retrying in 60 seconds...') //error handling
}
}, 60000)
};
The problem is he’s not getting into the catch()
and is, after some loop runs, making the page lock and close. Can you help me? What is being done wrong?