How to press two keys at once? eg. Ctrl + A/S #2699
Answered
by
mdmintz
alexwideman
asked this question in
Q&A
|
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! |
Answered by
mdmintz
Apr 15, 2024
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 |
0 replies
Answer selected by
mdmintz
|
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 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The CTRL+S is an action that takes place outside the web page itself, which means you need to use something like
pyautoguito do that, as mentioned on Stack Overflow here: https://stackoverflow.com/a/63055535/7058266