How to set Selenium Python WebDriver default timeout?
The best way is to set preference:
fp = webdriver.FirefoxProfile()
fp.set_preference("http.response.timeout", 5)
fp.set_preference("dom.max_script_run_time", 5)
driver = webdriver.Firefox(firefox_profile=fp)
driver.get("http://www.google.com/")
In python, the method to create a timeout for a page to load is:
Firefox, Chromedriver and undetected_chromedriver:
driver.set_page_load_timeout(30)
Other:
driver.implicitly_wait(30)
This will throw a TimeoutException
whenever the page load takes more than 30 seconds.