I have one site where I can't enter a password
using send_keys
, I have to use Ctrl+V there. But I don't know how this can be done, because I have Passwords
, where all passwords are stored and I need to take it from there
from Passwords import password
#how to copy?
inputpassword = driver.find_element(By.XPATH, "Path")
inputpassword.???
#how to paste by Ctrl + V
There are 2 steps here:
import pyperclip
pyperclip.copy('The text to be copied to the clipboard.')
More examples and explanations can be find here and here.
Then you can simply paste the clipboard content into a web element input with Selenium with regular CTRL + V
keys
//now paste your content from clipboard
el = self.driver.find_element_by_xpath(xpath)
el.send_keys(Keys.CONTROL + 'v')