Skip to content

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

Timings

magmueller101868af2226
diff --git a/src/controller/service.py b/src/controller/service.py
index 21f175777..1f069a2b1 100644
--- a/src/controller/service.py
+++ b/src/controller/service.py
@@ -20,7 +20,7 @@ class ControllerService:
self.browser = BrowserService()
self.cached_browser_state: BrowserState | None = None
- @time_execution_sync('get_cached_browser_state')
+ @time_execution_sync('--get_cached_browser_state')
def get_cached_browser_state(self, force_update: bool = False) -> BrowserState:
if self.cached_browser_state is None or force_update:
self.cached_browser_state = self.browser.get_updated_state()
@@ -43,7 +43,7 @@ class ControllerService:
screenshot=screenshot_b64,
)
- @time_execution_sync('act')
+ @time_execution_sync('--act')
def act(self, action: ControllerActions) -> ControllerActionResult:
try:
current_state = self.get_cached_browser_state(force_update=False)
diff --git a/src/dom/service.py b/src/dom/service.py
index f2674c746..de342ba51 100644
--- a/src/dom/service.py
+++ b/src/dom/service.py
@@ -3,6 +3,7 @@ from selenium import webdriver
from selenium.webdriver.common.by import By
from src.dom.views import DomContentItem, ProcessedDomContent
+from src.utils import time_execution_sync
class DomService:
@@ -16,6 +17,7 @@ class DomService:
html_content = self.driver.page_source
return self._process_content(html_content)
+ @time_execution_sync('--_process_content')
def _process_content(self, html_content: str) -> ProcessedDomContent:
"""
Process HTML content to extract and clean relevant elements.