> ## 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`](/automation-sdks/intuned-sdk/typescript/helpers/functions/uploadFileToS3) (TypeScript) or [`upload_file_to_s3`](/automation-sdks/intuned-sdk/python/helpers/functions/upload_file_to_s3) (Python).

<CodeGroup dropdown>
  ```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
  ```
</CodeGroup>

## Related SDK methods

<CardGroup cols={2}>
  <Card title="uploadFileToS3 (TypeScript)" icon="js" href="/automation-sdks/intuned-sdk/typescript/helpers/functions/uploadFileToS3">
    TypeScript SDK helper for uploading files to S3
  </Card>

  <Card title="upload_file_to_s3 (Python)" icon="python" href="/automation-sdks/intuned-sdk/python/helpers/functions/upload_file_to_s3">
    Python SDK helper for uploading files to S3
  </Card>

  <Card title="Cookbook (Python)" icon="github" href="https://github.com/Intuned/cookbook/tree/main/python-examples/quick-recipes">
    Python quick recipes in the Intuned Cookbook
  </Card>

  <Card title="Cookbook (TypeScript)" icon="github" href="https://github.com/Intuned/cookbook/tree/main/typescript-examples/quick-recipes">
    TypeScript quick recipes in the Intuned Cookbook
  </Card>
</CardGroup>
