I have this on a website
div class="accept" onclick="javascript:ClosePopup(true);" ...
If I run "ClosePopup(true)" in the browser console, the button works and closes the popup.
In selenium, I think something like driver.executeScript(ClosePopup(true)) but that is not the correct way. Please advice how to click the button once that is a popup that shows up only sometimes and do not have id, only a class but the class has 4 or more buttons inside.
I am using selenium with python 3.8.