-1
Sometimes when rooting a page I use an error alert appears in the first option, so I have to click on option 2, so I would like to set an IF command,so that when the error alert appears, the script clickasse in the second option, but I do not know how to configure the if. The error code is this:
<div role="alert" aria-live="polite" aria-atomic="true" class="error flash__message"><div class="flash__message-content">You have too low respect to enter this place< data-dismiss="alert" aria-label="alertClose" class="flash__close-button"><span aria-hidden="true">×</span></button></div>
And this is my script:
setInterval(function enter() {
var entrar1 = document.getElementsByClassName('pull-right')[5];
var entrar2 = document.getElementsByClassName('pull-right')[7];
if (AQUI VAI O COMANDO DO ERRO,PORÉM NÃO SEI COLOCAR") {
entrar2.click();
} else {
entrar1.click();
}
},1000);
NOTE: I am using tampermonkey to automate the script.
In case I just wanted to set the IF in case that alert appears
– lololololo