from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys driver = webdriver.Chrome() driver.get("https://www.***.cn") #回车 driver.find_element(By.CSS_SELECTOR,"***").send_keys(Keys.ENTER)
#空格 driver.find_element(By.CSS_SELECTOR,"***").send_keys(Keys.SPACE)
#Tab driver.find_element(By.CSS_SELECTOR,"***").send_keys(Keys.TAB)
#删除 driver.find_element(By.CSS_SELECTOR,"***").send_keys(Keys.BACK_SPACE)
#Esc driver.find_element(By.CSS_SELECTOR,"***").send_keys(Keys.ESCAPE)
#组合键Ctrl+C driver.find_element(By.CSS_SELECTOR,"***").send_keys(Keys.CONTROL,'c')
#F1 driver.find_element(By.CSS_SELECTOR,"***").send_keys(Keys.F1)
#Pagedown driver.find_element(By.CSS_SELECTOR,"***").send_keys(Keys.PAGE_DOWN) driver.quit()