selenium 元素操作

1、鼠标左键点击

click()

2、键盘输入

send_keys()

3、清空默认值

clear()

4、form表单提交

submit()

5、Select下拉框的三个操作

select_by_value(选项的value属性的值)

select_by_index(第几个选项)

select_by_visible_text(选项的文本值)

6、selenium中所有的高级操作,都被封装在ActionChains类中

 例如:双击

ActionChains(driver).double_click(driver.find_element_by_id("7")).perform()

原文地址:https://www.cnblogs.com/String-song/p/12826904.html