Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
tiny import and format fixes
Gregor Žunič10af7535e841
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex ef60b3fd7..76bd14493 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -11,14 +11,13 @@ from dotenv import load_dotenvfrom langchain_core.language_models.chat_models import BaseChatModelfrom langchain_core.messages import (BaseMessage,- HumanMessage,SystemMessage,)from openai import RateLimitErrorfrom pydantic import BaseModel, ValidationErrorfrom browser_use.agent.message_manager.service import MessageManager-from browser_use.agent.prompts import SystemPrompt+from browser_use.agent.prompts import AgentMessagePrompt, SystemPromptfrom browser_use.agent.views import (ActionResult,AgentError,diff --git a/browser_use/browser/service.py b/browser_use/browser/service.pyindex 514dc636d..bf4122e66 100644--- a/browser_use/browser/service.py+++ b/browser_use/browser/service.py@@ -9,7 +9,6 @@ import loggingimport osimport timefrom dataclasses import dataclass-from pathlib import Pathfrom playwright.async_api import Browser as PlaywrightBrowserfrom playwright.async_api import (@@ -45,12 +44,16 @@ class Browser:MAXIMUM_WAIT_TIME = 5def __init__(- self, headless: bool = False, keep_open: bool = False, disable_security: bool = False, cookies_path: str | None = None+ self,+ headless: bool = False,+ keep_open: bool = False,+ disable_security: bool = False,+ cookies_path: str | None = None,):self.headless = headlessself.keep_open = keep_openself.disable_security = disable_security- self.cookies_file = cookies_path+ self.cookies_file = cookies_path# Initialize these as None - they'll be set up when neededself.session: BrowserSession | None = None