Skip to content

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

Replace asterisk markers with <new> tags for new elements

Cursor Agent05ef6dcc82d4
diff --git a/browser_use/agent/system_prompt.md b/browser_use/agent/system_prompt.md
index 33819f357..6e1d272d2 100644
--- a/browser_use/agent/system_prompt.md
+++ b/browser_use/agent/system_prompt.md
@@ -56,12 +56,12 @@ 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<new>[35]</new><button aria-label='Submit form'>Submit</button>
Note that:
- Only elements with numeric indexes in [] are interactive
- (stacked) indentation (with \t) is important and means that the element is a (html) child of the element above (with a lower index)
-- Elements with \* are new elements that were added after the previous step (if url has not changed)
+- Elements with <new> tags are new elements that were added after the previous step (if url has not changed)
- Pure text elements without [] are not interactive.
</browser_state>
diff --git a/browser_use/agent/system_prompt_no_thinking.md b/browser_use/agent/system_prompt_no_thinking.md
index 46ce35a39..b27294d19 100644
--- a/browser_use/agent/system_prompt_no_thinking.md
+++ b/browser_use/agent/system_prompt_no_thinking.md
@@ -56,12 +56,12 @@ 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<new>[35]</new><button aria-label='Submit form'>Submit</button>
Note that:
- Only elements with numeric indexes in [] are interactive
- (stacked) indentation (with \t) is important and means that the element is a (html) child of the element above (with a lower index)
-- Elements with \* are new elements that were added after the previous step (if url has not changed)
+- Elements with <new> tags are new elements that were added after the previous step (if url has not changed)
- Pure text elements without [] are not interactive.
</browser_state>
diff --git a/browser_use/dom/views.py b/browser_use/dom/views.py
index 0964f37cc..c9b179e60 100644
--- a/browser_use/dom/views.py
+++ b/browser_use/dom/views.py
@@ -195,7 +195,7 @@ class DOMElementNode(DOMBaseNode):
# Build the line
if node.is_new:
- highlight_indicator = f'*[{node.highlight_index}]*'
+ highlight_indicator = f'<new>[{node.highlight_index}]</new>'
else:
highlight_indicator = f'[{node.highlight_index}]'