Keyboard events
The previous send_keys() method is used to simulate keyboard input; the keys() class provides methods for almost all keys on the keyboard, and key combinations are also possible.
Commonly used keyboard operations are as follows.
send_keys(Keys.BACK_SPACE) Delete key (BackSpace)
send_keys(Keys.SPACE) Space key (Space)
send_keys(Keys.TAB) Tabulation key (Tab)
send_keys(Keys.ESCAPE) Return key (Esc)
send_keys(Keys.ENTER) Enter key (Enter)
send_keys(Keys.CONTROL,’a’) Select All (Ctrl+A)
send_keys(Keys.CONTTROL,’c’) Copy (Ctrl+C)
send_keys(Keys.CONTTROL,’x’) Cut (Ctrl+X)
send_keys(Keys.CONTTROL,’v’) Paste (Ctrl+V)
send_keys(Keys.F1) Keyboard F1
……
send_keys(Keys.F12) Keyboard F12
Keys.BACK_SPACE: Back Space key (BackSpace)
Keys.TAB: Tab key (Tab)
Keys.ENTER: Enter key (Enter)
SHIFT: Case conversion key (Shift)
Keys.CONTROL: Control key (Ctrl)
Keys.ALT: ALT key (Alt)
Keys.ESCAPE: Return key (Esc)
Keys.SPACE: Space bar (Space)
Keys.PAGE_UP: Page up key (Page Up)
PAGE_DOWN: page down key (Page Down)
Keys.END: End of line key (End)
Keys.
LEFT: left arrow key (Left)
Keys.UP: Arrow keys up (Up)
Keys.RIGHT: arrow key right (Right)
DOWN: Down arrow key (Down)
INSERT: Insert key (Insert)
DELETE: Delete key (Delete)
NUMPAD0 ~ NUMPAD9: numeric keys 1-9
F1 ~ F12: F1 – F12 keys
(Keys.CONTROL, ‘a’): key combination Control+a, select all
(Keys.CONTROL, ‘c’): key combination Control+c, copy
(Keys.CONTROL, ‘x’): key combination Control+x, cut
(Keys.CONTROL, ‘v’): key combination Control+v, Paste
Read More:
- Chromdriver Install error: File “C:\python37\lib\site-packages\selenium\webdriver\common\service.py”, line 76, in start stdin=PIPE) File…
- [Solved] Selenium.common.exceptions.WebDriverException: Message: newSession
- [Solved] selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn
- [Solved] selenium.common.exceptions.JavascriptException: Message: javascript error: windows is not defined
- [Solved] Selenium python send_key error: list object has no attribute
- [Solved] Python Selenium Error: AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_xpath‘
- Python+Selenium Error: AttributeError: ‘WebDriver‘ NameError: name ‘By‘ is not defined
- Python Selenium: element is not attached to the page document error
- [Solved] Python-selenium locates an element cannot be clicked error: ElementClickInterceptedException
- [Solved] Selenium error: staleelementreferenceexception exception
- [Python] Right-click Selenium to Save the picture error: attributeerror: solution to module ‘pyscreen’ has no attribute ‘locationonwindow’
- [Solved] AttributeError: module ‘selenium.webdriver‘ has no attribute ‘Chrome‘
- [Solved] Selenium Error: ERROR: Message: element not interactable
- Mac Selenium Use Error: Can not connect to the Service chromedriver
- [Solved] NPM install Error: check python checking for Python executable python2 in the PATH
- How to Solve Python WARNING: Ignoring invalid distribution -ip (e:\python\python_dowmload\lib\site-packages)
- Invalid python sd, Fatal Python error: init_fs_encoding: failed to get the Python cod [How to Solve]
- XGBoost Common Errors and Their Solutions
- Tensorflow: Common Usage of tf.get_variable_scope()
- [Solved] selenium Error: ERROR:ssl_client_socket_impl.cc(962)] handshake failed; returned -1, SSL