You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If it is possible in the documentation to understand how to use trio_cdp for event management like cdp.network.RequestWillBeSent ... it would be of great help
The text was updated successfully, but these errors were encountered:
The documentation definitely needs to be improved for event handling. On the Trio CDP side, there are two APIs. The first API waits for a single event and returns the result.
asyncwithsession.wait_for(network.RequestWillBeSent) asresult:
await ... # do something here that triggers an eventprint(result.value) # the value is available after leaving the block
Since this one loops over the events, you'll want to call it in a new task so that you can keep doing work on the main task.
On the Chrome side, the protocol events are documented pretty poorly. I've figured out a few of them by trial and error, though. With the network domain, you will need to call network.enable() prior to getting any events. You might also try the fetch domain which has similar features but is a little friendlier.
Hi,
If it is possible in the documentation to understand how to use trio_cdp for event management like cdp.network.RequestWillBeSent ... it would be of great help
The text was updated successfully, but these errors were encountered: