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
preload url fix punctuation with brackets
Magnus Müller76bd5f21d7ee
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex 4a1658503..077847592 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -1206,7 +1206,7 @@ class Agent(Generic[Context, AgentStructuredOutput]):if match:url = match.group(0)# Remove trailing punctuation that's not part of URLs- url = re.sub(r'[.,;:!?]+$', '', url)+ url = re.sub(r'[.,;:!?()\[\]]+$', '', url)# Add https:// if missingif not url.startswith(('http://', 'https://')):url = 'https://' + url