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

# Playwright Interoperability

> How Stagehand interacts with Playwright

Stagehand is built on top of [Playwright](https://playwright.dev/), so you can use Playwright methods directly through the Stagehand instance.

## `page` and `context`

`stagehand.page` and `stagehand.context` are instances of Playwright's `Page` and `BrowserContext` respectively. Use these methods to interact with the Playwright instance that Stagehand is using.

<CodeGroup>
  ```TypeScript TypeScript theme={null}
  const page = stagehand.page;
  // Base Playwright methods work
  await page.goto("https://github.com/browserbase/stagehand");

  // Stagehand overrides Playwright objects
  await page.act("click on the contributors")
  ```

  ```python Python theme={null}
  page = stagehand.page
  # Base Playwright methods work
  await page.goto("https://github.com/browserbase/stagehand")

  # Stagehand overrides Playwright objects
  await page.act("click on the contributors")
  ```
</CodeGroup>

## Stagehand v. Playwright

Below is an example of how to extract a list of companies from the AI Grant website using both Stagehand and Playwright.

<img src="https://mintcdn.com/readme-i18n/wcXsxm33rwhC6LZ-/images/stagehand-playwright.png?fit=max&auto=format&n=wcXsxm33rwhC6LZ-&q=85&s=c43245e95cf655c08dd191d4df6cdfd5" alt="Stagehand v. Playwright" width="2263" height="1998" data-path="images/stagehand-playwright.png" />

The above example with Stagehand can be easily reused to extract data from other websites, whereas the Playwright example would need to be rewritten for each new website.
