Depending on the code provided, the setInterval() function you use hits a button at 20-second intervals. This approach can cause the page to be clicked frequently in a short period of time, which can cause the page to crash.
To avoid this, try using the setTimeout() function. This will perform a click after a certain amount of time, and then again after a certain amount of time. This way, you can set a long interval for each click, and the page doesn't click frequently in a short period of time.
Here is sample code using the setTimeout() function:
function clickButton() {
document.getElementsByClassName("MuiIconButton-colorPrimary")[0].click();
setTimeout(clickButton, 20*1000);
}
setTimeout(clickButton, 20*1000);
In the sample code above, we define a function called clickButton() that first clicks on the button and then waits 20 seconds before calling itself again. Finally, we call clickButton() with the setTimeout() function after the page loads, so that clicking automatically starts after 20 seconds after the page loads.
Please note that no matter which method is used, great care should be taken to avoid damage to the site. Before attempting this method, it is a good idea to obtain permission from the site owner and follow the site's rules of use.