Page
One page, driven programmatically.
Every call suspends, takes a timeout, and cancels cleanly: cancelling the calling coroutine destroys the session on every path, including mid-navigation. Once close has run, every call raises ErrorCode.DETACHED.
A timeout defaulting to zero means "use the value from BrowserConfig.timeouts".
The shape is Playwright's on purpose. Anyone who knows that API knows this one.
Inheritors
Functions
Installs a script that runs before any page script, on this and every subsequent document.
Blocks loading of specific resource categories (e.g. ResourceType.Images, ResourceType.Fonts).
What this session can do. Branch on it instead of discovering a gap through a failure.
Clears cookies for a domain, or all of them when domain is null.
Clears local storage, session storage and IndexedDB.
Registers a callback fired for every console message logged by the page.
Registers a callback fired for every received response.
Empty when nothing matches. Unlike querySelector, this is not an error.
Captures the viewport by drawing the view.
Waits for the element, then scrolls the viewport so it is visible.
Waits for the element, then selects an option on a <select> by its value.
Merges headers into every subsequent outgoing request.
Overrides the User-Agent header sent with every subsequent request.
Waits until a JavaScript expression is truthy.
Waits for an element to exist. Returns as soon as it appears, not on a poll tick.