Skip to main content

Playwright APIRequest builder

Project description

:performing_arts: Playwright APIRequest builder

Checked with mypy Code style: black Imports: isort

Documented

Read it here :link: documentation
Read more about the builder pattern on :link: refactoring.guru

Example

# sync example
from playwright.sync_api import sync_playwright
from playwright_request.sync_builder import RequestBuilder

with sync_playwright() as p:
    builder = RequestBuilder(p, base_url='https://playwright.dev/')
    request = builder.get("python/docs/intro").create_request()
    response = request()
    print(response.text())
# async example
import asyncio
from playwright.async_api import async_playwright
from playwright_request.async_builder import RequestBuilder

async def main():
    async with async_playwright() as p:
        builder = RequestBuilder(p, base_url='https://playwright.dev/')
        request = builder.get("python/docs/intro").create_request()
        response = await request()
        print(await response.text())

asyncio.run(main())

Requirements

Python3
Playwright >= 1.26.0

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

playwright-apirequest-builder-1.0.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file playwright-apirequest-builder-1.0.0.tar.gz.

File metadata

File hashes

Hashes for playwright-apirequest-builder-1.0.0.tar.gz
Algorithm Hash digest
SHA256 758d5857e73a7e4a41bd1bba2662b64163fd4f9467841398329b2edc73d0f399
MD5 401209050c75ec7b716f7ddb6c9cdc70
BLAKE2b-256 cd7adab28254cafbb27ed7860be7addbc56f77cdbc7f1aed61d70b0387150b2c

See more details on using hashes here.

File details

Details for the file playwright_apirequest_builder-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for playwright_apirequest_builder-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ce7a760664a78fef1862900e4d98be31b3eb067ec489fec30b6d23123219371
MD5 e4667c8020228a72873dc3ae54e4fbc7
BLAKE2b-256 72c518c8590750be175542b31e0e6abf604c502b67b779291f18892e40fdea6d

See more details on using hashes here.

Supported by

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