I have a website with a donorbox button. When it's clicked, an iframe is added to the page as a modal. I want to access the elements in that iframe but I get an error Cannot read property 'click' of null
when I try to click one of the buttons with a simple document.getElementsByClassName('db_button')[0].click();
command.
Debugging in the console, I also get the same message until I inspect the element and then it seems to work fine. What am I doing wrong?