octaltree / playwright-rust

Playwright port to Rust
298 stars 31 forks source link

monitor request and response #18

Closed initprism closed 2 years ago

initprism commented 2 years ago

Thank you for making a good library. I need response data from the page. This feature is in the rust-headless-chrome, but the overall stability of the library is poor. src_line

I found this in the playwrite document. Can I use it here, too? network-events

octaltree commented 2 years ago

You can receive the event stream with subscribe_event. expect_event is to wait only once with a timeout from the event stream for a specific event.

https://github.com/octaltree/playwright-rust/blob/9f615c2b27a4caa4e71b3c3374beb31c7f816c3b/tests/page/mod.rs#L65-88