鼠标活动事件:

 

from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
import time
driver = webdriver.Firefox()
driver.get("https://www.sina.com.cn/")
ele = driver.find_element_by_link_text("移动客户端")
#ActionChains(driver)用于生成模拟用户行为、move_to_element()鼠标停在一个元素上、perform()执行存储行为
ActionChains(driver).move_to_element(ele).perform()
time.sleep(1)
sub_ele = driver.find_element_by_link_text("新浪微博")
time.sleep(1)
sub_ele.click()
原文地址:https://www.cnblogs.com/zhang-da/p/12057741.html