Skip to content

Commit 94aa845

Browse files
authored
Update 2025-09-25-br-playwright-ga-stagehand-limits.mdx
indentations
1 parent 2f159e4 commit 94aa845

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

src/content/changelog/browser-rendering/2025-09-25-br-playwright-ga-stagehand-limits.mdx

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,38 @@ To get started with Stagehand, check out this [example guide](/browser-rendering
1616
![Stagehand video](~/assets/images/browser-rendering//stagehand.gif)
1717

1818
```ts title="Stagehand example"
19-
const stagehand = new Stagehand({
20-
env: "LOCAL",
21-
localBrowserLaunchOptions: { cdpUrl: endpointURLString(env.BROWSER) },
22-
llmClient: new WorkersAIClient(env.AI),
23-
verbose: 1,
24-
});
19+
const stagehand = new Stagehand({
20+
env: "LOCAL",
21+
localBrowserLaunchOptions: { cdpUrl: endpointURLString(env.BROWSER) },
22+
llmClient: new WorkersAIClient(env.AI),
23+
verbose: 1,
24+
});
2525

26-
await stagehand.init();
27-
const page = stagehand.page;
26+
await stagehand.init();
27+
const page = stagehand.page;
2828

29-
await page.goto('https://demo.playwright.dev/movies');
29+
await page.goto('https://demo.playwright.dev/movies');
3030

31-
// if search is a multi-step action, stagehand will return an array of actions it needs to act on
32-
const actions = await page.observe('Search for "Furiosa"');
33-
for (const action of actions)
34-
await page.act(action);
31+
// if search is a multi-step action, stagehand will return an array of actions it needs to act on
32+
const actions = await page.observe('Search for "Furiosa"');
33+
for (const action of actions)
34+
await page.act(action);
3535

36-
await page.act('Click the search result');
36+
await page.act('Click the search result');
3737

38-
// normal playwright functions work as expected
38+
// normal playwright functions work as expected
3939
await page.waitForSelector('.info-wrapper .cast');
4040

41-
let movieInfo = await page.extract({
42-
instruction: 'Extract movie information',
43-
schema: z.object({
44-
title: z.string(),
45-
year: z.number(),
46-
rating: z.number(),
47-
genres: z.array(z.string()),
48-
duration: z.number().describe("Duration in minutes"),
49-
}),
50-
});
51-
52-
await stagehand.close();
41+
let movieInfo = await page.extract({
42+
instruction: 'Extract movie information',
43+
schema: z.object({
44+
title: z.string(),
45+
year: z.number(),
46+
rating: z.number(),
47+
genres: z.array(z.string()),
48+
duration: z.number().describe("Duration in minutes"),
49+
}),
50+
});
51+
52+
await stagehand.close();
5353
```

0 commit comments

Comments
 (0)