Skip to content

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

fix

Laith Weinberger581ab0d9012d
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index eedf3551b..abbdcb23a 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -2380,7 +2380,8 @@ class Agent(Generic[Context, AgentStructuredOutput]):
url = match.group(0)
original_position = match.start() # Store original position before URL modification
- # Skip fragments of URLs already matched by earlier pattern if any(match.start() < end and match.end() > start for start, end in matched_spans):
+ # Skip fragments of URLs already matched by earlier pattern
+ if any(match.start() < end and match.end() > start for start, end in matched_spans):
continue
matched_spans.append((match.start(), match.end()))