|
41 | 41 |
|
42 | 42 | ---
|
43 | 43 |
|
44 |
| -Stagehand is the easiest way to build browser automations. It is fully compatible with [Playwright](https://playwright.dev/), offering three simple AI APIs (`act`, `extract`, and `observe`) on top of the base Playwright `Page` class that provide the building blocks for web automation via natural language. It also makes Playwright more accessible to non-technical users and less vulnerable to minor changes in the UI/DOM. |
| 44 | +Stagehand is the easiest way to build browser automations. It is fully compatible with [Playwright](https://playwright.dev/), offering three simple AI APIs (`act`, `extract`, and `observe`) on top of the base Playwright `Page` class that provide the building blocks for web automation via natural language. |
45 | 45 |
|
46 |
| -Anything that can be done in a browser can be done with Stagehand. Consider: |
| 46 | +Here's a sample of what you can do with Stagehand: |
47 | 47 |
|
48 |
| -1. Go to Hacker News and extract the top stories of the day |
49 |
| -1. Log into Amazon, search for AirPods, and buy the most relevant product |
50 |
| -1. Go to ESPN, search for Steph Curry, and get stats for his last 10 games |
| 48 | +```typescript |
| 49 | +// Keep your existing Playwright code unchanged |
| 50 | +await page.goto("https://docs.stagehand.dev"); |
51 | 51 |
|
52 |
| -Stagehand makes it easier to write durable, performant browser automation code. When used with [Browserbase](https://browserbase.com/), it offers unparalleled debugging tools like session replay and step-by-step debugging. |
| 52 | +// Stagehand AI: Extract data from the page |
| 53 | +const { description } = await page.extract({ |
| 54 | + instruction: "Extract the description of the page", |
| 55 | + schema: z.object({ |
| 56 | + description: z.string(), |
| 57 | + }), |
| 58 | +}); |
| 59 | + |
| 60 | +// Stagehand AI: Act on the page |
| 61 | +await page.act({ action: "click on the 'Quickstart'" }); |
| 62 | +``` |
| 63 | + |
| 64 | +## Why? |
| 65 | +**Stagehand adds determinism to otherwise unpredictable agents.** |
| 66 | + |
| 67 | +While there's no limit to what you could instruct Stagehand to do, our primitives allow you to control how much you want to leave to an AI. It works best when your code is a sequence of atomic actions. Instead of writing a single script for a single website, Stagehand allows you to write durable, self-healing, and repeatable web automation workflows that actually work. |
53 | 68 |
|
54 | 69 | > [!NOTE]
|
55 | 70 | > `Stagehand` is currently available as an early release, and we're actively seeking feedback from the community. Please join our [Slack community](https://join.slack.com/t/stagehand-dev/shared_invite/zt-2tdncfgkk-fF8y5U0uJzR2y2_M9c9OJA) to stay updated on the latest developments and provide feedback.
|
|
0 commit comments