Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

fix for follow_up_tasks example

Nick Sweetingaa6e62b0d2f2
diff --git a/examples/features/follow_up_tasks.py b/examples/features/follow_up_tasks.py
index aa326691a..77ed3e9bd 100644
--- a/examples/features/follow_up_tasks.py
+++ b/examples/features/follow_up_tasks.py
@@ -3,9 +3,7 @@ import asyncio
from dotenv import load_dotenv
from langchain_openai import ChatOpenAI
-from browser_use import Agent
-from browser_use.agent.views import ActionResult
-from browser_use.controller.service import Controller
+from browser_use import Agent, Browser, BrowserConfig, BrowserContextConfig, Controller
load_dotenv()
@@ -14,12 +12,22 @@ llm = ChatOpenAI(
model='gpt-4o',
temperature=0.0,
)
+# Get your chrome path
+browser = Browser(
+ config=BrowserConfig(
+ browser_instance_path='/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
+ new_context_config=BrowserContextConfig(
+ _force_keep_context_alive=True,
+ ),
+ ),
+)
+
controller = Controller()
task = 'Find the founders of browser-use and draft them a short personalized message'
-agent = Agent(task=task, llm=llm, controller=controller)
+agent = Agent(task=task, llm=llm, controller=controller, browser=browser)
async def main():