from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
(将expected_conditions 通过as关键字起个别名:EC)
WebDriverWait(driver, timeout, poll_frequency=0.5)
1). driver:浏览器对象
2). timeout:超时的时长,单位:秒
3). poll_frequency:检测间隔时间,默认为0.5秒
调用方法 until(method):直到..时
1). method:调用EC.presence_of_element_located(element)
element:调用By类方法进行定位
from selenium.webdriver.support.select import Select
WebDriver类库中并没有直接提供对滚动条进行操作方法,但是它提供了可调用JavaScript脚本的方法,所
以我们可以通过JavaScript脚本来达到操作滚动条的目的;
备注:
1). 滚动条:一种可控制程序显示范围的组件
2). JavaScript:一种流行脚本语言,可以操作HTML标签;
JavaScript学习资料:http://www.w3school.com.cn/js/js_intro.asp
import unittest