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
Bigfix: in case if node element has a shadow dom, all other children nodes are not processed
alexdfd5b124f2e2
diff --git a/browser_use/dom/buildDomTree.js b/browser_use/dom/buildDomTree.jsindex 539c76225..ddd6b70ee 100644--- a/browser_use/dom/buildDomTree.js+++ b/browser_use/dom/buildDomTree.js@@ -955,16 +955,16 @@if (domElement) nodeData.children.push(domElement);}}- // Handle shadow DOM- else if (node.shadowRoot) {- nodeData.shadowRoot = true;- for (const child of node.shadowRoot.childNodes) {- const domElement = buildDomTree(child, parentIframe);- if (domElement) nodeData.children.push(domElement);- }- }- // Handle regular elementselse {+ // Handle shadow DOM+ if (node.shadowRoot) {+ nodeData.shadowRoot = true;+ for (const child of node.shadowRoot.childNodes) {+ const domElement = buildDomTree(child, parentIframe);+ if (domElement) nodeData.children.push(domElement);+ }+ }+ // Handle regular elementsfor (const child of node.childNodes) {const domElement = buildDomTree(child, parentIframe);if (domElement) nodeData.children.push(domElement);