"""
鼠标悬停
ActionChains(driver).move_to_element(元素名).perform()
鼠标左击长按
ActionChains(driver).click_and_hold(元素名).perform()
鼠标双击
ActionChains(driver).double_click(元素名).perform()
"""
from selenium import webdriver
from time import sleep
from selenium.webdriver.common.action_chains import ActionChains # 导入ActionChains类
driver=webdriver.Chrome()
url="https://www.baidu.com/"
driver.get(url)
driver.maximize_window()
sleep(3)
settings=driver.find_element_by_css_selector("span#s-usersetting-top") # <span id="s-usersetting-top" name="tj_settingicon">设置</span>
ActionChains(driver).move_to_element(settings).perform() # 鼠标悬停百度首页设置链接
sleep(5)
driver.quit()