Stagehand 4.5.0: page.on('console') deprecated, use page.onConsole()
Stagehand 4.5.0 (TypeScript and Python) deprecates page.on('console') for page.onConsole() and adds getByRole() and getByText().
Your keys
0 of 1 ready
Create each key on its own page, paste it below, then copy the finished lines into your project's .env file. Your keys stay in this tab. They are never sent to Wirestack or saved; we only count that the panel was used.
- OpenAI API keyOPENAI_API_KEYGet key
Model key Stagehand uses to read the page. Needed for a local browser.
What changed
Stagehand 4.5.0 for TypeScript and Python (published to npm and PyPI on November 25, 2026):
page.on("console", listener)is deprecated. It still works the same way for now.- New
page.onConsole()in TypeScript andpage.on_console()in Python for console subscriptions. - New
page.onResponse()/page.on_response()to watch network responses from a page and its child frames. - New
getByRole()/get_by_role()andgetByText()/get_by_text()queries, and locator chaining into elements and iframes. - Fixes include
networkidlewaits on idle pages and host-only cookie domains.
What to do
Swap page.on("console", ...) for page.onConsole(...) (or page.on_console(...) in Python) when you upgrade, so a later release that removes the old form does not break you. Stagehand reads OPENAI_API_KEY for the model in our integrations.
Source
Affected by this? Start from a checked Stagehand integration
Code with pinned versions, checked against the official docs on a schedule.
