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
Fix: update shadow root attribute in HTMLSerializer to use 'shadowroot' instead of 'shadowrootmode', enhancing compatibility with declarative shadow DOM syntax.
Magnus Müllercb4cfb113090
diff --git a/browser_use/dom/serializer/html_serializer.py b/browser_use/dom/serializer/html_serializer.pyindex 5050cfa17..8aaf31df7 100644--- a/browser_use/dom/serializer/html_serializer.py+++ b/browser_use/dom/serializer/html_serializer.py@@ -45,12 +45,11 @@ class HTMLSerializer:elif node.node_type == NodeType.DOCUMENT_FRAGMENT_NODE:# Shadow DOM root - wrap in template with shadowrootmode attribute- # This is the declarative shadow DOM syntax that html2text can processparts = []# Add shadow root openingshadow_type = node.shadow_root_type or 'open'- parts.append(f'<template shadowrootmode="{shadow_type.lower()}">')+ parts.append(f'<template shadowroot="{shadow_type.lower()}">')# Serialize shadow childrenfor child in node.children: