Skip to content

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

Fix screenshots

Magnus Müller9edad03d2356
diff --git a/browser_use/browser/events.py b/browser_use/browser/events.py
index d7ab84d96..e20f39718 100644
--- a/browser_use/browser/events.py
+++ b/browser_use/browser/events.py
@@ -141,8 +141,8 @@ class CloseTabEvent(BaseEvent[None]):
event_timeout: float | None = 10.0 # seconds
-class ScreenshotEvent(BaseEvent[bytes]):
- """Request to take a screenshot. Returns screenshot as bytes."""
+class ScreenshotEvent(BaseEvent[str]):
+ """Request to take a screenshot. Returns screenshot as base64 string."""
full_page: bool = False
clip: dict[str, float] | None = None # {x, y, width, height}