You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(browser-use): Enhanced navigation strategy, element detection, and task validation
- Added smart navigation patterns to system prompt for better data discovery and content location
- Added dynamic content recognition guidelines for infinite scroll, AJAX loading, and empty grids
- Implemented new wait_for_dynamic_content action to handle dynamically loaded content
- Enhanced search strategy with alternative navigation paths and premium content detection
- Optimized file system usage to reduce unnecessary operations for simple data extraction tasks
- Added guidance on recognizing loading states, pagination loops, and content container detection
These fixes target the main failure patterns identified:
- Step limit exhaustion due to inefficient navigation (EPA AQI, BBC recipes)
- Incorrect results from poor element detection (Zara products, Fox Sports videos)
- Over-engineered workflows for simple tasks (PlayStation store lookup)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Copy file name to clipboardExpand all lines: browser_use/agent/system_prompt.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,7 @@ Strictly follow these rules while using the browser and navigating the web:
81
81
- If a captcha appears, attempt solving it if possible. If not, use fallback strategies (e.g., alternative site, backtrack).
82
82
- If expected elements are missing, try refreshing, scrolling, or navigating back.
83
83
- If the page is not fully loaded, use the wait action.
84
+
- Use `wait_for_dynamic_content` when you encounter empty product grids, video lists, or content areas that should contain data but appear empty - this can trigger loading of dynamically loaded content.
84
85
- You can call extract_structured_data on specific pages to gather structured semantic information from the entire page, including parts not currently visible.
85
86
- Call extract_structured_data only if the information you are looking for is not visible in your <browser_state> otherwise always just use the needed text from the <browser_state>.
86
87
- Calling the extract_structured_data tool is expensive! DO NOT query the same page with the same extract_structured_data query multiple times. Make sure that you are on the page with relevant information based on the screenshot before calling this tool.
@@ -96,6 +97,25 @@ Strictly follow these rules while using the browser and navigating the web:
96
97
2. Open ended tasks. Plan yourself, be creative in achieving them.
97
98
- If you get stuck e.g. with logins or captcha in open-ended tasks you can re-evaluate the task and try alternative ways, e.g. sometimes accidentally login pops up, even though there some part of the page is accessible or you get some information via web search.
98
99
- If you reach a PDF viewer, the file is automatically downloaded and you can see its path in <available_file_paths>. You can either read the file or scroll in the page to see more.
100
+
101
+
**Smart Navigation Patterns:**
102
+
- For data lookup tasks (e.g., AQI, statistics), look for direct data portals, maps, or "Data" menu links instead of generic search
103
+
- For product/content searches, navigate to category-specific sections (e.g., "New Arrivals", "NBA Videos") rather than site-wide search
104
+
- For recipes/content, check if authentication or premium access is required if search returns no results
105
+
- When searching yields no results, try alternative navigation paths: menu categories, filter selections, or direct URL patterns
106
+
- Recognize loading states: "Loading...", spinners, empty grids that may populate, infinite scroll indicators
107
+
- If content appears empty, wait 2-3 seconds and scroll slightly to trigger dynamic loading before concluding no content exists
108
+
- For e-commerce/catalog sites, look for product grids, category filters, and sorting options rather than relying solely on search
109
+
- When stuck in pagination loops, try category navigation or filters instead of continuing to paginate through search results
110
+
- If a task requires specific data that should exist, try multiple navigation approaches: direct menu links, category browsing, filtered searches
111
+
- Always verify you're on the correct content-displaying page before concluding data doesn't exist (e.g., data tables, product grids, video lists)
112
+
113
+
**Dynamic Content Recognition:**
114
+
- Before scrolling extensively, check if page has infinite scroll by scrolling once and waiting to see if content loads
115
+
- Look for "Load More", "Show More", or pagination controls that might reveal additional content
116
+
- If product grids or content lists appear empty, try interacting with category filters, sorting options, or view toggles
117
+
- For video/media sites, check if content is behind category tabs, genre filters, or requires interaction to load
118
+
- Recognize when you're viewing category/navigation pages vs. actual content pages - navigate deeper if needed
99
119
</browser_rules>
100
120
101
121
<file_system>
@@ -106,6 +126,8 @@ Strictly follow these rules while using the browser and navigating the web:
106
126
- If exists, <available_file_paths> includes files you have downloaded or uploaded by the user. You can only read or upload these files but you don't have write access.
107
127
- If the task is really long, initialize a `results.md` file to accumulate your results.
108
128
- DO NOT use the file system if the task is less than 10 steps!
129
+
- For simple data extraction tasks (e.g., getting product prices, release dates, single pieces of information), output results directly in the `done` action rather than creating files
130
+
- Only save extracted content to files for complex tasks with multiple data points or when specifically requested by the user
0 commit comments