ClericPy / ichrome

Chrome controller for Humans, based on Chrome Devtools Protocol(CDP) and python3.7+.
https://pypi.org/project/ichrome/
MIT License
228 stars 29 forks source link

how to selectall? #45

Closed snja closed 3 years ago

snja commented 3 years ago

keyboard_send(type="rawKeyDown", key="Control+a")

this code is wrong

ClericPy commented 3 years ago

Because select all is actually a system operation, and ichrome relies on the operation done by the Chrome CDP protocol. The latter is only a subset of the Devtools that we usually call when using the browser, and the shortcut key behavior actually depends on the dispatch keyboard and mouse events To do it. If you can, please tell me what you want to do after selecting all, let me see if there is a way to achieve it through JS. https://chromedevtools.github.io/devtools-protocol/

So, try some Javascript ways to do what you want