> ## Documentation Index
> Fetch the complete documentation index at: https://skyvern.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Frames

> Work inside iframes.

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.

> [!NOTE]
>
> Python only: the TypeScript SDK has no equivalent.

```python Python theme={null}
await page.frame_switch(
    *,
    selector: str | None = None,
    name: str | None = None,
    index: int | None = None,
) -> dict[str, Any]
```

**Parameters**

**selector** `str | None`

CSS selector for the iframe element (uses content\_frame()).

Default: `None`

**name** `str | None`

Frame name attribute.

Default: `None`

**index** `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**

```python Python theme={null}
import asyncio

from skyvern import Skyvern


async def main() -> None:
    skyvern = Skyvern(api_key="YOUR_API_KEY")
    browser = await skyvern.launch_cloud_browser()
    page = await browser.get_working_page()
    await page.goto("https://example.com")
    result = await page.frame_switch(selector="#payment-iframe")
    print(result)
    await browser.close()


asyncio.run(main())
```

***

## page.frame\_main

Switch back to the main page frame, clearing the working iframe.

> [!NOTE]
>
> Python only: the TypeScript SDK has no equivalent.

```python Python theme={null}
page.frame_main() -> dict[str, str]
```

**Returns** `dict[str, str]`

**Example**

```python Python theme={null}
import asyncio

from skyvern import Skyvern


async def main() -> None:
    skyvern = Skyvern(api_key="YOUR_API_KEY")
    browser = await skyvern.launch_cloud_browser()
    page = await browser.get_working_page()
    await page.goto("https://example.com")
    result = page.frame_main()
    print(result)
    await browser.close()


asyncio.run(main())
```

***

## page.frame\_list

List all frames on the current page.

> [!NOTE]
>
> Python only: the TypeScript SDK has no equivalent.

```python Python theme={null}
await page.frame_list() -> list[dict[str, Any]]
```

**Returns** `list[dict[str, Any]]` — List of dicts with name, url, is\_main, and index for each frame.

**Example**

```python Python theme={null}
import asyncio

from skyvern import Skyvern


async def main() -> None:
    skyvern = Skyvern(api_key="YOUR_API_KEY")
    browser = await skyvern.launch_cloud_browser()
    page = await browser.get_working_page()
    await page.goto("https://example.com")
    result = await page.frame_list()
    print(result)
    await browser.close()


asyncio.run(main())
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.