Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Python中设置SeleniumWebDriver上的脚本超时?_Python_Selenium_Selenium Webdriver - Fatal编程技术网

如何在Python中设置SeleniumWebDriver上的脚本超时?

如何在Python中设置SeleniumWebDriver上的脚本超时?,python,selenium,selenium-webdriver,Python,Selenium,Selenium Webdriver,中的Java有三种超时函数: 迫切地等待 页面加载超时 设置脚本超时 我正试图查找与第三个类似的python,但找不到它。下面是前两个的python等价物 隐式等待(10) 设置页面加载超时(20) 这就是你想要的吗: set_script_timeout(time_to_wait) Set the amount of time that the script should wait during an execute_async_script call before

中的Java有三种超时函数:

  • 迫切地等待
  • 页面加载超时
  • 设置脚本超时
  • 我正试图查找与第三个类似的python,但找不到它。下面是前两个的python等价物

  • 隐式等待(10)
  • 设置页面加载超时(20)

  • 这就是你想要的吗:

    set_script_timeout(time_to_wait)
    
        Set the amount of time that the script should wait during an
            execute_async_script call before throwing an error.
    
        Args :  
    
            time_to_wait: The amount of time to wait (in seconds)
    
        Usage : 
    
        driver.set_script_timeout(30)
    
    参考-