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
wrap windows async adjustment in except
Nick Sweeting2195ce6e1b51
diff --git a/browser_use/__init__.py b/browser_use/__init__.pyindex c7ec40c0c..30a37bdac 100644--- a/browser_use/__init__.py+++ b/browser_use/__init__.py@@ -3,11 +3,14 @@ import sysfrom browser_use.logging_config import setup_logging-setup_logging()+logger = setup_logging()# Set Windows event loop policy for Playwright compatibilityif sys.platform.startswith('win'):- asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())+ try:+ asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())+ except Exception as e:+ logger.error(f'❌ Failed to set Windows event loop policy: {type(e).__name__}: {e}')from browser_use.agent.prompts import SystemPromptfrom browser_use.agent.service import Agentdiff --git a/browser_use/logging_config.py b/browser_use/logging_config.pyindex 4b62d6141..5138e8d28 100644--- a/browser_use/logging_config.py+++ b/browser_use/logging_config.py@@ -137,3 +137,5 @@ def setup_logging():third_party = logging.getLogger(logger_name)third_party.setLevel(logging.ERROR)third_party.propagate = False++ return logger