Skip to content

Commit 90530b7

Browse files
authored
Update extract docs + remove redundant section (#1342)
# why - v2 jump links for `extract` were broken - v3 jump links for `extract` were also broken + included a redundant section # what changed <img width="707" height="797" alt="image" src="https://github.com/user-attachments/assets/9b4bce83-a126-4627-854e-90d2b812b19a" /> <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fix broken jump links in the v2 and v3 extract docs and remove a redundant section to improve navigation and clarity. - **Bug Fixes** - v2: Updated "prompt-only" anchor to #prompt-only-extraction. - v3: Standardized anchors to #instruction-only and #no-parameters; fixed Card link to #basic-schema. - v3: Removed duplicate "Using extract()" section; renamed to "Return value". <sup>Written for commit 29acc0d. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
1 parent c7ee968 commit 90530b7

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

packages/docs/v2/basics/extract.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description: Extract structured data from a webpage
99
page.extract("extract the name of the repository");
1010
```
1111

12-
`extract` grabs structured data from a webpage. You can define your schema with [zod](https://github.com/colinhacks/zod) (TypeScript) or [pydantic](https://github.com/pydantic/pydantic) (Python). If you do not want to define a schema, you can also call `extract` with just a [natural language prompt](#extract-with-just-a-prompt), or call `extract` [with no parameters](#extract-with-no-parameters).
12+
`extract` grabs structured data from a webpage. You can define your schema with [zod](https://github.com/colinhacks/zod) (TypeScript) or [pydantic](https://github.com/pydantic/pydantic) (Python). If you do not want to define a schema, you can also call `extract` with just a [natural language prompt](#prompt-only-extraction), or call `extract` [with no parameters](#extract-with-no-parameters).
1313

1414
## Why use `extract()`?
1515

packages/docs/v3/basics/extract.mdx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,20 @@ description: Extract structured data from a webpage
99
await stagehand.extract("extract the name of the repository");
1010
```
1111

12-
`extract` grabs structured data from a webpage. You can define your schema with [zod](https://github.com/colinhacks/zod) (TypeScript) or JSON. If you do not want to define a schema, you can also call `extract` with just a [natural language prompt](#extract-with-just-a-prompt), or call `extract` [with no parameters](#extract-with-no-parameters).
12+
`extract()` grabs structured data from a webpage. You can define your schema with [Zod](https://github.com/colinhacks/zod) (TypeScript) or JSON. If you don't want to define a schema, you can also call `extract` with just a [natural language prompt](#instruction-only), or call `extract` [with no parameters](#no-parameters).
1313

1414
## Why use `extract()`?
1515

1616
<CardGroup cols={2}>
17-
<Card title="Structured" icon="brackets-curly" href="#list-of-objects-extraction">
17+
<Card title="Structured" icon="brackets-curly" href="#basic-schema">
1818
Turn messy webpage data into clean objects that follow a schema.
1919
</Card>
2020
<Card title="Resilient" icon="dumbbell" href="#extract-with-context">
2121
Build resilient extractions that don't break when the website changes
2222
</Card>
2323
</CardGroup>
2424

25-
## Using `extract()`
26-
27-
You can use `extract()` to extract structured data from a webpage. You can define your schema with [zod](https://github.com/colinhacks/zod) (TypeScript) or JSON. If you do not want to define a schema, you can also call `extract` with just a natural language prompt, or call `extract` with no parameters.
28-
29-
```typescript
30-
const result = await stagehand.extract("extract the product details");
31-
```
32-
33-
### Return value of `extract()`?
25+
## Return value
3426

3527
When you use `extract()`, Stagehand will return a `Promise<ExtractResult>` with the following structure:
3628
<Tabs>

0 commit comments

Comments
 (0)