Python Selenium Timeout Exception Catch
Almost of your code is working fine except the Driver.Close(). It should be Driver.close(). The TimeoutException will be thrown when the page is not loaded within specific time. See my code below: from selenium import webdriver from selenium.common.exceptions import TimeoutException Driver = webdriver.Firefox() try: Driver.set_page_load_timeout(1) Driver.get(“http://www.engadget.com”) except TimeoutException as ex: isrunning = 0 print(“Exception has … Read more