We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e9f81bf commit 4cabdefCopy full SHA for 4cabdef
pydoll/browser/page.py
@@ -246,6 +246,18 @@ async def get_screenshot(self, path: str):
246
async with aiofiles.open(path, 'wb') as file:
247
await file.write(screenshot_bytes)
248
249
+ async def get_screenshot_base64(self):
250
+ """
251
+ Retrieves the screenshot of the page as a base64 encoded string.
252
+
253
+ Returns:
254
+ str: The base64 encoded screenshot.
255
256
+ # TODO: remove the duplicated logic
257
258
+ response = await self._execute_command(PageCommands.screenshot())
259
+ return response['result']['data'].encode('utf-8')
260
261
async def set_download_path(self, path: str):
262
"""
263
Sets the download path for the page.
0 commit comments