Skip to content

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

Update browser_use/dom/views.py

Magnus Müller48c75ffd3d28
diff --git a/browser_use/dom/views.py b/browser_use/dom/views.py
index 703102b0f..3053ecde6 100644
--- a/browser_use/dom/views.py
+++ b/browser_use/dom/views.py
@@ -730,7 +730,7 @@ class EnhancedDOMTreeNode:
'itemprop',
]
)
- attributes_string = ''.join(f'{key}={value}' for key, value in self.attributes.items() if key in static_attributes)
+ attributes_string = ''.join(f"{k}={v}" for k, v in sorted((k, v) for k, v in self.attributes.items() if k in static_attributes))
# Combine both for final hash
combined_string = f'{parent_branch_path_string}|{attributes_string}'