In my case, I don't want to wait more than 15 seconds after calling the method driver.get()
. I have the following code:
...
driver.set_page_load_timeout(15)
try:
driver.get(url)
except TimeoutException as e:
pass
try:
WebDriverWait(driver, 0.5).until(EC.alert_is_present())
alert = input_driver.switch_to.alert
alert.dismiss()
except (TimeoutException, WebDriverException):
pass
But it still takes in some cases (not sure when) more than 5 minutes. What am I doing false?