Skip to content

Commit 2481ee2

Browse files
authored
fix screenshot env bb (#111)
1 parent 782f683 commit 2481ee2

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "stagehand"
7-
version = "0.0.5"
7+
version = "0.0.6"
88
description = "Python SDK for Stagehand"
99
readme = "README.md"
1010
license = {text = "MIT"}

stagehand/page.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -374,33 +374,6 @@ async def extract(
374374
)
375375
return result_dict
376376

377-
async def screenshot(self, options: Optional[dict] = None) -> str:
378-
"""
379-
Take a screenshot of the current page via the Stagehand server.
380-
381-
Args:
382-
options (Optional[dict]): Optional screenshot options.
383-
May include:
384-
- type: "png" or "jpeg" (default: "png")
385-
- fullPage: whether to take a full page screenshot (default: False)
386-
- quality: for jpeg only, 0-100 (default: 80)
387-
- clip: viewport clip rectangle
388-
- omitBackground: whether to hide default white background (default: False)
389-
390-
Returns:
391-
str: Base64-encoded screenshot data.
392-
"""
393-
payload = options or {}
394-
395-
if self._stagehand.use_api:
396-
lock = self._stagehand._get_lock_for_session()
397-
async with lock:
398-
result = await self._stagehand._execute("screenshot", payload)
399-
400-
return result
401-
else:
402-
return await self._page.screenshot(**payload)
403-
404377
# Method to get or initialize the persistent CDP client
405378
async def get_cdp_client(self) -> CDPSession:
406379
"""Gets the persistent CDP client, initializing it if necessary."""

0 commit comments

Comments
 (0)