1 导入相关模块
from selenium.webdriver import ActionChains
from selenium.webdriver.common.keys import Keys
2 先定位元素,再进行鼠标操作
Element=broswer.find_element(By.ID,value)
3 全选:Ctrl+A
Element.send_keys(Keys.CONTROL,"a")
4 复制:Ctrl+C
Element.send_keys(Keys.CONTROL,"c")
5 剪切:Ctrl+X
Element.send_keys(Keys.CONTROL,"x")
6 粘贴:Ctrl+V
Element.send_keys(Keys.CONTROL,"v")
7 空格
Element.send_keys(Keys.SPACE)
8 回车键
Element.send_keys(Keys.ENTER)
9 后退键
Element.send_keys(Keys.BACKSPACE)
10 TAB键
Element.send_keys(Keys.TAB)
11 刷新键
Element.send_keys(Keys.F5)