-
Notifications
You must be signed in to change notification settings - Fork 203
support iframe and nested iframes. use playwright instead of patchright #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
596f68a
4c21b72
96a8c14
918d961
675ea52
898cc64
82e2977
80282da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,14 +3,46 @@ import dotenv from "dotenv"; | |
|
|
||
| dotenv.config(); | ||
|
|
||
| const agent = new HyperAgent(); | ||
| // const agent = new HyperAgent(); | ||
|
|
||
| // (async () => { | ||
| // const page = await agent.newPage(); | ||
| // page.ai( | ||
| // "Go to https://flights.google.com and find a round-trip flight from Rio de Janeiro to Los Angeles, leaving on November 11, 2025, and returning on November 22, 2025, and select the option with the least carbon dioxide emissions." | ||
| // ); | ||
|
|
||
| // const page2 = await agent.newPage(); | ||
| // await page2.goto("https://maps.google.com"); | ||
| // page2.ai("Find the nearest restaurant to the current page"); | ||
| // })(); | ||
|
|
||
| (async () => { | ||
| const agent = new HyperAgent({ | ||
| llm: { | ||
| provider: "anthropic", | ||
| model: "claude-sonnet-4-0", | ||
| }, | ||
| // browserProvider: "Hyperbrowser", | ||
| debug: true, | ||
| }); | ||
| const page = await agent.newPage(); | ||
| page.ai( | ||
| "Go to https://flights.google.com and find a round-trip flight from Rio de Janeiro to Los Angeles, leaving on November 11, 2025, and returning on November 22, 2025, and select the option with the least carbon dioxide emissions." | ||
| page.goto("https://flights.google.com"); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Async navigation mis-timed due to missing awaitMissing |
||
| await page.aiAction("click source location box"); | ||
| await page.aiAction("type 'Rio de Janeiro' into the source location box"); | ||
| await page.aiAction("press enter"); | ||
| await page.aiAction("click destination location box"); | ||
| await page.aiAction("type 'Los Angeles' into the destination location box"); | ||
| await page.aiAction("press enter"); | ||
| await page.aiAction("click the departure date box"); | ||
| await page.aiAction( | ||
| "fill 12/01/2025 into the departure date box" | ||
| ); | ||
| const page2 = await agent.newPage(); | ||
| await page2.goto("https://maps.google.com"); | ||
| page2.ai("Find the nearest restaurant to the current page"); | ||
| await page.aiAction("click the return date box"); | ||
| await page.aiAction("fill 12/22/2025 into the return date box"); | ||
| await page.aiAction("click the search button"); | ||
| await page.aiAction("click the first flight option"); | ||
|
|
||
| // const page2 = await agent.newPage(); | ||
| // await page2.goto("https://maps.google.com"); | ||
| // page2.ai("Find the nearest restaurant to the current page"); | ||
| })(); | ||
Uh oh!
There was an error while loading. Please reload this page.