You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-37Lines changed: 21 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,12 +35,10 @@
35
35
</a>
36
36
</p>
37
37
38
-
39
-
> This is a Python SDK for Stagehand. We also have a TypeScript SDK available <ahref="https://github.com/browserbase/stagehand" >here</a>.
40
-
41
-
42
38
> Stagehand Python SDK is currently available as an early release, and we're actively seeking feedback from the community. Please join our [Slack community](https://stagehand.dev/slack) to stay updated on the latest developments and provide feedback.
43
39
40
+
> We also have a TypeScript SDK available <ahref="https://github.com/browserbase/stagehand" >here</a>.
41
+
44
42
## Why Stagehand?
45
43
46
44
*Stagehand is the easiest way to build browser automations with AI-powered interactions.*
@@ -55,7 +53,7 @@ Most existing browser automation tools either require you to write low-level cod
55
53
56
54
-----
57
55
58
-
### TL;DR Automate the web *reliably* with natural language:
56
+
### TL;DR: Automate the web *reliably* with natural language:
59
57
60
58
-**act** — Instruct the AI to perform actions (e.g. click a button or scroll).
61
59
```python
@@ -89,27 +87,26 @@ from dotenv import load_dotenv
89
87
from pydantic import BaseModel, Field, HttpUrl
90
88
91
89
from stagehand import StagehandConfig, Stagehand
92
-
from stagehand.typesimport ExtractOptions
90
+
from stagehand.schemasimport ExtractOptions
93
91
94
92
# Load environment variables
95
93
load_dotenv()
96
94
97
95
# Define Pydantic models for structured data extraction
98
96
classCompany(BaseModel):
99
-
name: str= Field(..., description="The name of the company")
100
-
url: HttpUrl = Field(..., description="The URL of the company website or relevant page")
101
-
102
-
classCompanies(BaseModel):
103
-
companies: list[Company] = Field(..., description="List of companies extracted from the page, maximum of 5 companies")
0 commit comments