docs(browsers): add note for Python about channels in launch() (#33396)

This commit is contained in:
Max Schmitt 2024-11-01 17:45:07 +01:00 committed by GitHub
parent c95feccce4
commit 33593c5f06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -401,6 +401,23 @@ pytest test_login.py --browser-channel msedge
dotnet test -- Playwright.BrowserName=chromium Playwright.LaunchOptions.Channel=msedge dotnet test -- Playwright.BrowserName=chromium Playwright.LaunchOptions.Channel=msedge
``` ```
######
* langs: python
Alternatively when using the library directly, you can specify the browser [`option: BrowserType.launch.channel`] when launching the browser:
```python
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
# Channel can be "chrome", "msedge", "chrome-beta", "msedge-beta" or "msedge-dev".
browser = p.chromium.launch(channel="msedge")
page = browser.new_page()
page.goto("http://playwright.dev")
print(page.title())
browser.close()
```
#### Installing Google Chrome & Microsoft Edge #### Installing Google Chrome & Microsoft Edge
If Google Chrome or Microsoft Edge is not available on your machine, you can install If Google Chrome or Microsoft Edge is not available on your machine, you can install