from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait as wwait
from selenium.webdriver.support import expected_conditions as EC
def wait_until(bc,locator,type=1): '''bc=driver,类似locator=(By.ID,'kw'),type{1:visible,2:clickable,3:frame switch}''' wait=wwait(bc,10,0.2)
#等待页面元素可见,返回该页面元素
if type==1: return wait.until(EC.visibility_of_element_located(locator))
selenium 显示等待wait.until 常用封装 及下拉框的选择操作等
最新推荐文章于 2024-06-03 18:38:37 发布