Skip to content

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

Log button name

magmueller5f6b23bc115f
diff --git a/browser_use/controller/service.py b/browser_use/controller/service.py
index 08f4f5eac..ce3a4e26c 100644
--- a/browser_use/controller/service.py
+++ b/browser_use/controller/service.py
@@ -94,7 +94,7 @@ class Controller:
try:
await browser._click_element_node(element_node)
- msg = f'🖱️ Clicked index {params.index}, with text: {element_node.get_all_text_till_next_clickable_element()}'
+ msg = f'🖱️ Clicked button with index {params.index}: {element_node.get_all_text_till_next_clickable_element(max_depth=2)}'
logger.info(msg)
logger.debug(f'Element xpath: {element_node.xpath}')