How to spam a button on with a while true without crashing with click()

Basically I tried to do:

`while (true) {

document.querySelector(“#main > footer > div._2BU3P.tm2tP.copyable-area > div > span:nth-child(2) > div > div._2lMWa > div._3HQNh._1Ae7k > button”).click()

}`

but it just crash, how can I make it stable?

I’am expecting to spam the button but without crashing.