Skip to content

Commit ec8989b

Browse files
authored
incorporate feedback on readme (#410)
* add a code sample to the readme * indent * indent * act * add section on how it works * remove bb from readme * why * final
1 parent c73ccbe commit ec8989b

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,30 @@
4141

4242
---
4343

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.
4545

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:
4747

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");
5151

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.
5368

5469
> [!NOTE]
5570
> `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

Comments
 (0)