Last updated:
0 purchases
playwrightapirequestbuilder 1.0.0
:performing_arts: Playwright APIRequest builder
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
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.