I am new to python, but need to modify code created by someone else. I am not able to post the full code, but I posted most of it below:
from bs4 import Beau
I dont know if the below code will help you, at one point I faced the same problem and ended up waiting for an alert and then accepting the alert, worked for me.
from selenium.common.exceptions import NoAlertPresentException,
def wait_for_alert(self):
for i in range(50):
try:
alert = chrome_session.switch_to.alert
if alert.text:
break
except NoAlertPresentException:
pass
time.sleep(.25)
else:
raise NoAlertPresentException("Alert visibility timed out")
return alert
wait_for_alert().accept()