Skip to main content
Switch the page’s working frame to run actions inside an iframe, then switch back.

page.frame_switch

Switch the working context to an iframe. Exactly one parameter required.
Python only: the TypeScript SDK has no equivalent.
Parameters
str | None
CSS selector for the iframe element (uses content_frame()).Default: None
str | None
Frame name attribute.Default: None
int | None
Frame index in page.frames list (0 = main frame).Default: None
Returns dict[str, Any] — Dict with frame name, url, and the parameter used to switch. Example

page.frame_main

Switch back to the main page frame, clearing the working iframe.
Python only: the TypeScript SDK has no equivalent.
Returns dict[str, str] Example

page.frame_list

List all frames on the current page.
Python only: the TypeScript SDK has no equivalent.
Returns list[dict[str, Any]] — List of dicts with name, url, is_main, and index for each frame. Example