-
Hi! Please share the method of sending a message to a websocket connection. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
For non-UI actions using CDP, you'll first need to find a valid CDP method for it here: https://chromedevtools.github.io/devtools-protocol/ (Eg. in https://chromedevtools.github.io/devtools-protocol/tot/Network/ or https://chromedevtools.github.io/devtools-protocol/tot/Page/). And then find the Python CDP version for it available here: https://github.com/mdmintz/MyCDP. Here's an example of calling a CDP method directly from a script: There are also examples of From within a script, you can access the tab = sb.cdp.get_active_tab()
tab.send(mycdp.DOMAIN.METHOD_NAME(ARGS)) For example, To use import mycdp |
Beta Was this translation helpful? Give feedback.
For non-UI actions using CDP, you'll first need to find a valid CDP method for it here: https://chromedevtools.github.io/devtools-protocol/ (Eg. in https://chromedevtools.github.io/devtools-protocol/tot/Network/ or https://chromedevtools.github.io/devtools-protocol/tot/Page/). And then find the Python CDP version for it available here: https://github.com/mdmintz/MyCDP.
Here's an example of calling a CDP method directly from a script:
SeleniumBase/examples/cdp_mode/raw_xhr_sb.py
Line 46 in 7f70a16
There are also examples of
connection.send()
as part of internal methods. Eg:SeleniumBase/seleniumbase/und…