Skip to content

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

removed unnecesary ]* after new element

Gregor Žunič33fc9c5aeb2e
diff --git a/browser_use/agent/system_prompt.md b/browser_use/agent/system_prompt.md
index 37461b79c..c63dfd44a 100644
--- a/browser_use/agent/system_prompt.md
+++ b/browser_use/agent/system_prompt.md
@@ -56,7 +56,7 @@ Interactive Elements: All interactive elements will be provided in format as [in
Examples:
[33]<div>User form</div>
-\t*[35]*<button aria-label='Submit form'>Submit</button>
+\t*[35]<button aria-label='Submit form'>Submit</button>
Note that:
- Only elements with numeric indexes in [] are interactive
diff --git a/browser_use/dom/views.py b/browser_use/dom/views.py
index 5d4acabba..8fbd8e35a 100644
--- a/browser_use/dom/views.py
+++ b/browser_use/dom/views.py
@@ -244,7 +244,7 @@ class DOMElementNode(DOMBaseNode):
# Build the line
if node.is_new:
- highlight_indicator = f'*[{node.highlight_index}]*'
+ highlight_indicator = f'*[{node.highlight_index}]'
else:
highlight_indicator = f'[{node.highlight_index}]'
@@ -264,7 +264,7 @@ class DOMElementNode(DOMBaseNode):
elif not attributes_html_str:
line += ' '
- line += ' />' # 1 token
+ # line += ' />' # 1 token
formatted_text.append(line)
# Process children regardless