How to check if an alert is present on a page with JavaScript or Selenium
You can disable alerts with:
window.alert = () => false
from python that's:
driver.execute_script("window.alert = () => false")
Assume one is present on the exception of a non located element within a try/catch block, then try to use
driver.switchTo().alert().dismiss();
to proceed with the entended behavior :)