docs: fix typo in Python APIRequestContext example (#11861)

`playwright.chromium` should be `p.chromium`, etc.
This commit is contained in:
Aarni Koskela 2022-02-04 17:36:30 +02:00 committed by GitHub
parent c45dacc834
commit 6881db6817
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,13 +71,13 @@ with sync_playwright() as p:
# This will launch a new browser, create a context and page. When making HTTP
# requests with the internal APIRequestContext (e.g. `context.request` or `page.request`)
# it will automatically set the cookies to the browser page and vise versa.
browser = playwright.chromium.launch()
browser = p.chromium.launch()
context = browser.new_context(base_url="https://api.github.com")
api_request_context = context.request
page = context.new_page()
# Alternatively you can create a APIRequestContext manually without having a browser context attached:
# api_request_context = playwright.request.new_context(base_url="https://api.github.com")
# api_request_context = p.request.new_context(base_url="https://api.github.com")
# Create a repository.