Skip to main content

SDK for invoking Lambda Playwright service

Project description

Lambda Playwright SDK

A Python SDK for interacting with the Lambda Playwright service.

Installation

pip install lambda-playwright

Usage

Initialization

from lambda_playwright import LambdaPlaywright

# Initialize with environment variables (AWS_PLAYWRIGHT_FUNCTION_URL, AWS_PLAYWRIGHT_ACCESS_KEY, AWS_PLAYWRIGHT_SECRET_ACCESS)
client = LambdaPlaywright()

# Or explicitly
client = LambdaPlaywright(
    function_url="https://your-function-url.lambda-url.ap-southeast-1.on.aws",
    access_key_id="your-access-key-id",
    secret_access_key="your-secret-access-key",
    region="ap-southeast-2"
)

Visit a Page

response = client.visit({
    "url": "https://example.com",
    "actions": [
        {"type": "wait_for_selector", "selector": "a"}
    ],
})

print(response["html"])

Render HTML

response = client.render_html({
    "html_content": "<h1>Hello World</h1><script>document.write('Loaded');</script>",
    "actions": [],
    "scroll_to_bottom": True
})

print(response["html"])

Development

To run locally against a local Lambda container:

client = LambdaPlaywright(debug=True)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lambda_playwright-0.1.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lambda_playwright-0.1.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file lambda_playwright-0.1.2.tar.gz.

File metadata

  • Download URL: lambda_playwright-0.1.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for lambda_playwright-0.1.2.tar.gz
Algorithm Hash digest
SHA256 acf58bd10f32ed68ad6bb1cb5d6031111e58021f1adbcd215259502d589195fe
MD5 073b0b590988c1d2ca5e5cf1ac5d075b
BLAKE2b-256 ce776dc45435c22d19b936ed8a90f5f136f4c514834979d905d3bd1ccdf9d878

See more details on using hashes here.

File details

Details for the file lambda_playwright-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for lambda_playwright-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 594f28ae6cd9067b6646c34ea19243519a3104ff16cc924b6cfd082b1bb6938c
MD5 46ff912adc524f92503e1cca98f5755b
BLAKE2b-256 594bf0ec6c29fb36e9677fa6654bc592bfed11b0f743551c3e7562e36b2b8f18

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page