After clicking in this button:
var option_btn = document.querySelectorAll('[class*="sp_choice_type"]')[1]
the following button will be available in the web:
var refuse = document.querySelector('[class*="priv-reject-btn"]')[0]
but as is not available before clicking there, with the following piece of code won't work:
var option_btn = document.querySelectorAll('[class*="sp_choice_type"]')[1]
option_btn.addEventListener('click', ()=>{
setTimeout(()=>{
var refuse = document.querySelector('[class*="priv-reject-btn"]')[0];
refuse.addEventListener('click',() =>{
console.log("Eureka")
})
}, 5000)
})
I've also tried with some Promises, but didn't work either.
The case is in the site zonebourse.com with the button Option from the botton disclaimer and "Tout refuser" that is triggered just after clicking the Option