How to set Selenium Python WebDriver default timeout?

后端 未结 4 1100
星月不相逢
星月不相逢 2020-11-27 04:15

Trying to find a good way to set a maximum time limit for command execution latency in Selenium Python WebDriver. Ideally, something like:

my_driver = get_m         


        
4条回答
  •  时光说笑
    2020-11-27 04:39

    In python, the method to create a timeout for a page to load is:

    Firefox and 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.

提交回复
热议问题