Python自动化中的鼠标事件

1)from selenium.webdriver.common.action_chains import ActionChains  导入该模块

2)ActionChains(driver) :用于生成模拟用户行为

3)Perfrom() :执行储存行为

form selenium.webdriver.common.action_chains import ActionChains 导入模块

Ele = b.find_element_by_list_text(‘xxx’) 定位到该元素

ActionChains(driver).move_to_element(ele).perform() 模拟鼠标滑动并停止在该元素上显示下拉框

Ele2 =b.find_element_by_link_text(‘软件测试’) 定位下拉框里面的元素

Ele2.click() 点击跳转

原文地址:https://www.cnblogs.com/yanmou/p/10678107.html