botasaurus
botasaurus copied to clipboard
No way of doing keypresses
There currently is no way if doing key presses, for example I want to use tab to move between inputs for more realistic behaviour and input focussing
Bump
@Goolyio In the meantime i found that you can use pyautogui to press the necessary key
@doshibadev I managed to do it using custom CDP commands
from botasaurus_driver import cdp
def press_enter(driver: Driver):
driver.run_cdp_command(cdp.input_.dispatch_key_event(
type_="rawKeyDown",
native_virtual_key_code=13,
windows_virtual_key_code=13,
unmodified_text="\r",
text="\r"
))
driver.run_cdp_command(cdp.input_.dispatch_key_event(
type_="char",
native_virtual_key_code=13,
windows_virtual_key_code=13,
unmodified_text="\r",
text="\r"
))
driver.run_cdp_command(cdp.input_.dispatch_key_event(
type_="keyUp",
native_virtual_key_code=13,
windows_virtual_key_code=13,
unmodified_text="\r",
text="\r"
))