> ## Documentation Index
> Fetch the complete documentation index at: https://intunedhq.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Capture screenshots

## Recipe

This recipe shows how to capture a screenshot with Playwright's `page.screenshot()` and upload it with [`uploadFileToS3`](https://intunedhq.com/docs/automation-sdks/intuned-sdk/typescript/helpers/functions/uploadFileToS3) (TypeScript) or [`upload_file_to_s3`](https://intunedhq.com/docs/automation-sdks/intuned-sdk/python/helpers/functions/upload_file_to_s3) (Python).

```typescript TypeScript theme={null}
import { BrowserContext, Page } from "playwright";
import { uploadFileToS3 } from "@intuned/browser"

export default async function handler(
  params: any,
  page: Page,
  context: BrowserContext
) {
  await page.goto("https://www.example.com")

  // Capture screenshot as bytes
  const screenshotInBytes = await page.screenshot()

  // Upload to S3
  const uploadedFile = await uploadFileToS3({
    file: screenshotInBytes,
    fileNameOverride: "screenshot.png",
    contentType: "image/png"
  })

  // Get signed URL for access
  const signedUrl = await uploadedFile.getSignedUrl()
  console.log(
    `check here to see the screenshot: \x1b[1;4;36m\x1b]8;;${signedUrl}\x1b\\Click here\x1b]8;;\x1b\\\x1b[0m \n`
  )
  return uploadedFile
}
```

```python Python theme={null}
from playwright.async_api import Page
from intuned_browser import upload_file_to_s3

async def automation(page: Page, params=None, **_kwargs):
    await page.goto("https://www.example.com")

    # Capture screenshot as bytes
    screenshot_in_bytes = await page.screenshot()

    # Upload to S3
    uploaded_file = await upload_file_to_s3(
        screenshot_in_bytes,
        file_name_override="screenshot.png",
        content_type="image/png",
    )

    # Get signed URL for access
    signed_url = await uploaded_file.get_signed_url()
    print(
        f"Click here to see the screenshot: \033[1;4;36m\033]8;;{signed_url}\033\\Click here\033]8;;\033\\\033[0m \n"
    )
    return uploaded_file
```

## Related SDK methods

> [card] [uploadFileToS3 (TypeScript)](https://intunedhq.com/docs/automation-sdks/intuned-sdk/typescript/helpers/functions/uploadFileToS3.md)
>
> TypeScript SDK helper for uploading files to S3

> [card] [upload\_file\_to\_s3 (Python)](https://intunedhq.com/docs/automation-sdks/intuned-sdk/python/helpers/functions/upload_file_to_s3.md)
>
> Python SDK helper for uploading files to S3

> [card] [Cookbook (Python)](https://github.com/Intuned/cookbook/tree/main/python-examples/quick-recipes)
>
> Python quick recipes in the Intuned Cookbook

> [card] [Cookbook (TypeScript)](https://github.com/Intuned/cookbook/tree/main/typescript-examples/quick-recipes)
>
> TypeScript quick recipes in the Intuned Cookbook


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.