等待机制

1.隐式等待、显示等待

http://www.cnblogs.com/simple-free/p/8458361.html

 

2.

#实现等待需要用到下面三个库
from selenium.webdriver.common.by import By #用于指定 HTML 文件中 DOM 标签元素
from selenium.webdriver.support.ui import WebDriverWait #等待网页加载完成
from selenium.webdriver.support import expected_conditions as EC #指定等待网页加载结束条件

#等待输入框的出现,最长等待10秒,(By.ID,'depCity') 指的是输入框的元素 id="depCity"
                    WebDriverWait(driver,10).until(EC.presence_of_element_located((By.ID,'depCity')))

猜你喜欢

转载自blog.csdn.net/zjkpy_5/article/details/85105384
今日推荐