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-Selenium2中,在加载页面时,如何设置webdriver实例在发出超时异常之前应该等待的时间?_Python_Selenium_Selenium Webdriver_Python Bindings - Fatal编程技术网

在Python-Selenium2中,在加载页面时,如何设置webdriver实例在发出超时异常之前应该等待的时间?

在Python-Selenium2中,在加载页面时,如何设置webdriver实例在发出超时异常之前应该等待的时间?,python,selenium,selenium-webdriver,python-bindings,Python,Selenium,Selenium Webdriver,Python Bindings,我通过使用超时作为第三个参数来实例化webdriver进行了尝试,如下所示: self.driver = webdriver.Firefox(None, None, 5) 然后使用驱动程序获取这样的网页 self.driver.get("http://www.google.com") 但是,它会无限期地等待页面加载。 还试用了webdriverwaself.driver,其中self.driver是一个webdriver实例,但没有用 Windows Vista操作系统;Python 2.7

我通过使用超时作为第三个参数来实例化webdriver进行了尝试,如下所示:

self.driver = webdriver.Firefox(None, None, 5)
然后使用驱动程序获取这样的网页

self.driver.get("http://www.google.com")
但是,它会无限期地等待页面加载。 还试用了webdriverwaself.driver,其中self.driver是一个webdriver实例,但没有用

Windows Vista操作系统;Python 2.7;硒m2;Python Selenium绑定2.8

有什么想法吗


编辑:python似乎不存在它,而WebDriverWait应该像这样使用,对它的请求已经被提交到WebDriverWait中:

WebDriverWait(driver, 10).until(lambda driver : driver.title.lower().startswith("cheese!"))
请参阅: