Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
#1970 format
rendifcd90ae31f74
diff --git a/browser_use/dom/views.py b/browser_use/dom/views.pyindex 8a4585622..50e59c84d 100644--- a/browser_use/dom/views.py+++ b/browser_use/dom/views.py@@ -177,15 +177,15 @@ class DOMElementNode(DOMBaseNode):# if aria-label == text of the node, don't include itif (- attributes_to_include.get('aria-label')- and attributes_to_include.get('aria-label', '').strip() == text.strip()+ attributes_to_include.get('aria-label')+ and attributes_to_include.get('aria-label', '').strip() == text.strip()):del attributes_to_include['aria-label']# if placeholder == text of the node, don't include itif (- attributes_to_include.get('placeholder')- and attributes_to_include.get('placeholder', '').strip() == text.strip()+ attributes_to_include.get('placeholder')+ and attributes_to_include.get('placeholder', '').strip() == text.strip()):del attributes_to_include['placeholder']@@ -223,17 +223,14 @@ class DOMElementNode(DOMBaseNode):elif isinstance(node, DOMTextNode):# Add text only if it doesn't have a highlighted parentif (- node.parent.highlight_index is None- and node.parent- and node.parent.is_visible- and node.parent.is_top_element+ node.parent.highlight_index is None+ and node.parent+ and node.parent.is_visible+ and node.parent.is_top_element): # and node.is_parent_top_element()formatted_text.append(f'{depth_str}{node.text}')- try:- process_node(self, 0)- except Exception as e:- print(e)+ process_node(self, 0)return '\n'.join(formatted_text)