Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python selenium press ctrl + v at the same time

I'm trying to press Ctrl + V at the same time on selenium chromedriver, I tried a lot of different combinations, like element.send_keys(Keys.CONTROL, 'V') or very similar things. Nothing worked. I'm working on WIndows 10


1 Answers

According to the docs of the Selenium (The Docs), This is the solution for Control+C:

ActionChains(driver).key_down(Keys.CONTROL).send_keys('c').key_up(Keys.CONTROL).perform()

You can just exchange the 'c' key by 'v' and it should work
you can possibly add the element you trying it to insert into by changing keys.CONTROL to keys.CONTROL, element

like image 142
Timeler Avatar answered Mar 21 '26 06:03

Timeler