You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently (I think) theres only one way to take a screenshot (via
events):
```
screenshot_event = browser_session.event_bus.dispatch(ScreenshotEvent(full_page=True))
await screenshot_event
screenshot_b64 = await screenshot_event.event_result()
```
This is much easier:
```
screenshot_data = await browser_session.take_screenshot(full_page=True)
```
Also I need this for demos plz.
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds a simple screenshot API to BrowserSession, replacing the event‑bus
flow. Supports full-page, region, and element captures, with optional
file save and format control.
- **New Features**
- BrowserSession.take_screenshot(path=None, full_page=False,
format='png', quality=None, clip=None) returns bytes; supports
png/jpeg/webp, JPEG quality, optional clip, and saving to disk.
- BrowserSession.screenshot_element(selector, path=None, format='png',
quality=None) captures a CSS-selected element by auto-computing bounds.
- CI test verifies viewport and element screenshots return data.
<!-- End of auto-generated description by cubic. -->
0 commit comments