我正在使用一种不允许输入重音符号的表单,但它确实允许粘贴带有重音符号的文本。
如何将文本发送到剪贴板,然后将包含重音的文本粘贴到表单中?
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium import webdriver
options = Options()
options.headless = True
driver = webdriver.Chrome('chromedriver.exe',options=options)
driver.get('https://www.website.com')
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, openform))).click()
send accent text to clipboard
driver.find_element(By.XPATH, formfield).send_keys(Keys.CONTROL, 'v')