赞
踩
def implicility_wait(self):
self.driver.implicitly_wait(10) #在一开始设置10秒钟等待时间
self.driver.find_element_by_id('kw').send_keys('su')
self.driver.find_element_by_id('su').click()
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
def test_wait(self):
wait = WebDriverWait(self.driver,2)
wait.until(EC.title_contains('haha')) #等待直到页面标题包含百度
self.driver.find_element_by_id('kw').send_keys('su')
self.driver.find_element_by_id('su').click()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。