@@ -140,8 +140,8 @@ await stagehand.init();
140140const page = stagehand .context .pages ()[0 ];
141141await page .goto (" https://example.com" );
142142
143- // Or use the convenience getter
144- const page = stagehand .page ;
143+ // Or `await` the active page
144+ const page = stagehand .context . awaitActivePage () ;
145145await page .goto (" https://example.com" );
146146```
147147
@@ -173,8 +173,8 @@ const newPage = await stagehand.context.newPage();
173173// Set active page
174174stagehand .context .setActivePage (newPage );
175175
176- // Now stagehand.page returns newPage
177- await stagehand .act (" click button" ); // Acts on newPage
176+ // implicitly takes action on newPage
177+ await stagehand .act (" click button" );
178178```
179179
180180### act() Method Changes
@@ -650,7 +650,7 @@ const result = await agent.execute("Complete the checkout process");
650650v3 agents can now specify which page to operate on.
651651
652652``` typescript Stagehand v3 icon="/images/typescript.svg"
653- const page1 = stagehand .page ;
653+ const page1 = stagehand .context . pages ()[ 0 ]
654654const page2 = await stagehand .context .newPage ();
655655
656656const agent = stagehand .agent ({
@@ -885,16 +885,16 @@ await stagehand.close();
885885
886886### Error: Cannot find property 'page' on Stagehand instance
887887
888- ** Problem** : Direct ` stagehand.page ` access may not work immediately after init .
888+ ** Problem** : Direct ` stagehand.page ` is not supported in Stagehand v3 .
889889
890- ** Solution** : Use the Context API or ensure you're using the getter method :
890+ ** Solution** : Use the Context API or ` await ` the active page :
891891
892892``` typescript
893893// Use context API (recommended)
894894const page = stagehand .context .pages ()[0 ];
895895
896- // Or use the convenience getter
897- const page = stagehand .page ;
896+ // Or grab the active page
897+ const page = await stagehand .context . awaitActivePage () ;
898898```
899899
900900### Error: act() method not found on page
0 commit comments