• 查看主题

  • 查看主题说明文字
有价值的内容收集
#189 adm1n
周三 12月 09, 2020 9:40 am
# 键盘全选操作
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