Right now whenever I use that code on Chrome Console, it'll click the button as long as it's already there but what I'm trying to get it to do is to do the same thing when the button doesn't exist but exists at a random time.
(function (){
document.getElementsByClassName("buttonContent-18Mz6_")[0].click();
})();