Skip to content

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

step 2 <-> step 3

Gregor Žuniče793376f3402
diff --git a/browser_use/dom/serializer/serializer.py b/browser_use/dom/serializer/serializer.py
index 8b0084c3b..03dfbc2fe 100644
--- a/browser_use/dom/serializer/serializer.py
+++ b/browser_use/dom/serializer/serializer.py
@@ -74,14 +74,14 @@ class DOMTreeSerializer:
end_step1 = time.time()
self.timing_info['create_simplified_tree'] = end_step1 - start_step1
- # Step 3: Remove elements based on paint order
+ # Step 2: Remove elements based on paint order
start_step3 = time.time()
if self.paint_order_filtering and simplified_tree:
PaintOrderRemover(simplified_tree).calculate_paint_order()
end_step3 = time.time()
self.timing_info['calculate_paint_order'] = end_step3 - start_step3
- # Step 2: Optimize tree (remove unnecessary parents)
+ # Step 3: Optimize tree (remove unnecessary parents)
start_step2 = time.time()
optimized_tree = self._optimize_tree(simplified_tree)
end_step2 = time.time()