# 键盘全选操作
from selenium.webdriver.common.keys import Keys
driver.find_element_by_css_selector('#key-demo').send_keys(Keys.CONTROL,'a')
time.sleep(2)
# 键盘的复制操作
driver.find_element_by_css_selector('#key-demo').send_keys(Keys.CONTROL,'c')
time.sleep(2)
#键盘的剪切操作
driver.find_element_by_css_selector('#key-demo').send_keys(Keys.CONTROL,'x')
time.sleep(2)
#键盘的粘贴操作
driver.find_element_by_css_selector('#key-demo').send_keys(Keys.CONTROL,'v')
time.sleep(2)
#键盘的删除操作
driver.find_element_by_css_selector('#key-demo').send_keys(Keys.CONTROL,'a')
driver.find_element_by_css_selector('#key-demo').send_keys(Keys.BACKSPACE)
time.sleep(2)
文字来源:https://www.cnblogs.com/qiuqiu64/p/10512244.html
from selenium.webdriver.common.keys import Keys
driver.find_element_by_css_selector('#key-demo').send_keys(Keys.CONTROL,'a')
time.sleep(2)
# 键盘的复制操作
driver.find_element_by_css_selector('#key-demo').send_keys(Keys.CONTROL,'c')
time.sleep(2)
#键盘的剪切操作
driver.find_element_by_css_selector('#key-demo').send_keys(Keys.CONTROL,'x')
time.sleep(2)
#键盘的粘贴操作
driver.find_element_by_css_selector('#key-demo').send_keys(Keys.CONTROL,'v')
time.sleep(2)
#键盘的删除操作
driver.find_element_by_css_selector('#key-demo').send_keys(Keys.CONTROL,'a')
driver.find_element_by_css_selector('#key-demo').send_keys(Keys.BACKSPACE)
time.sleep(2)
文字来源:https://www.cnblogs.com/qiuqiu64/p/10512244.html