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() 点击跳转

相关文章:

  • 2022-02-08
  • 2021-07-10
  • 2021-10-04
  • 2021-08-28
  • 2022-02-08
  • 2022-12-23
  • 2021-04-27
猜你喜欢
  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
  • 2021-09-28
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案