Skip to content

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

Update empty DOM tree message to indicate potential loading delay

Magnus Müllercb4d206a4893
diff --git a/browser_use/dom/views.py b/browser_use/dom/views.py
index 5439207bb..2e6e778ba 100644
--- a/browser_use/dom/views.py
+++ b/browser_use/dom/views.py
@@ -441,7 +441,7 @@ class SerializedDOMState:
from browser_use.dom.serializer.serializer import DOMTreeSerializer
if not self._root:
- return 'Empty DOM tree'
+ return 'Empty DOM tree (you might have to wait for the page to load)'
include_attributes = include_attributes or DEFAULT_INCLUDE_ATTRIBUTES