How to press two keys at once? eg. Ctrl + A/S #2699
-
I'm using uc mode which is working well, thank you Michael! Once I get through to the PDF document, I've tried saving it with the following two approaches, but the PDFs are corrupted/won't open.
To avoid this, I want to mimic user behaviour by pressing CTRL+S. Is there a way to do it with press_keys? I have looked on the website and Github discussions and haven't be able to figure it out. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The CTRL+S is an action that takes place outside the web page itself, which means you need to use something like |
Beta Was this translation helpful? Give feedback.
-
I had to use "paste" and this worked for me: element = driver.find_element(...)
# Mac
element.send_keys(Keys.COMMAND + "v")
# Windows
element.send_keys(Keys.CONTROL + "v") Maybe it can help you with your problem |
Beta Was this translation helpful? Give feedback.
The CTRL+S is an action that takes place outside the web page itself, which means you need to use something like
pyautogui
to do that, as mentioned on Stack Overflow here: https://stackoverflow.com/a/63055535/7058266