44from rich .console import Console
55from rich .panel import Panel
66from rich .theme import Theme
7- import json
87from dotenv import load_dotenv
98
10- from stagehand import Stagehand , StagehandConfig
11- from stagehand .utils import configure_logging
9+ from stagehand import Stagehand , StagehandConfig , configure_logging
10+
11+ from browserbase .types import SessionCreateParams as BrowserbaseSessionCreateParams
1212
1313# Configure logging with cleaner format
1414configure_logging (
3434
3535load_dotenv ()
3636
37+ browserbase_session_create_params = BrowserbaseSessionCreateParams (
38+ project_id = os .getenv ("BROWSERBASE_PROJECT_ID" ),
39+ proxies = True ,
40+ )
41+
3742console .print (
3843 Panel .fit (
3944 "[yellow]Logging Levels:[/]\n "
@@ -52,6 +57,7 @@ async def main():
5257 env = "BROWSERBASE" ,
5358 api_key = os .getenv ("BROWSERBASE_API_KEY" ),
5459 project_id = os .getenv ("BROWSERBASE_PROJECT_ID" ),
60+ browserbase_session_create_params = browserbase_session_create_params ,
5561 headless = False ,
5662 dom_settle_timeout_ms = 3000 ,
5763 model_name = "google/gemini-2.0-flash" ,
@@ -98,7 +104,7 @@ async def main():
98104 await asyncio .sleep (2 )
99105
100106 console .print ("\n ▶️ [highlight] Observing page[/] for news button" )
101- observed = await page .observe ("find all articles " )
107+ observed = await page .observe ("find the news button " )
102108
103109 if len (observed ) > 0 :
104110 element = observed [0 ]
0 commit comments