Skip to content

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

refactor: Replace print with logger.debug in actor/page.py

constx13376b77410683bd
diff --git a/browser_use/actor/page.py b/browser_use/actor/page.py
index c912e2291..5f1c83e25 100644
--- a/browser_use/actor/page.py
+++ b/browser_use/actor/page.py
@@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, TypeVar
from pydantic import BaseModel
+from browser_use import logger
from browser_use.actor.utils import get_key_info
from browser_use.dom.serializer.serializer import DOMTreeSerializer
from browser_use.dom.service import DomService
@@ -129,8 +130,8 @@ class Page:
else:
expression = f'({page_function})()'
- # Debug: print the actual expression being evaluated
- print(f'DEBUG: Evaluating JavaScript: {repr(expression)}')
+ # Debug: log the actual expression being evaluated
+ logger.debug(f'Evaluating JavaScript: {repr(expression)}')
params: 'EvaluateParameters' = {'expression': expression, 'returnByValue': True, 'awaitPromise': True}
result = await self._client.send.Runtime.evaluate(