diff --git a/docs/src/auth.md b/docs/src/auth.md index 4500105b1b..bc84908c3e 100644 --- a/docs/src/auth.md +++ b/docs/src/auth.md @@ -218,14 +218,14 @@ os.environ["SESSION_STORAGE"] = session_storage # Set session storage in a new context session_storage = os.environ["SESSION_STORAGE"] -await context.add_init_script(storage => { +await context.add_init_script("""storage => { if (window.location.hostname == 'example.com') { entries = JSON.parse(storage) Object.keys(entries).forEach(key => { window.sessionStorage.setItem(key, entries[key]) }) } -}, session_storage) +}""", session_storage) ``` ```python sync @@ -236,14 +236,14 @@ os.environ["SESSION_STORAGE"] = session_storage # Set session storage in a new context session_storage = os.environ["SESSION_STORAGE"] -context.add_init_script(storage => { +context.add_init_script("""storage => { if (window.location.hostname == 'example.com') { entries = JSON.parse(storage) Object.keys(entries).forEach(key => { window.sessionStorage.setItem(key, entries[key]) }) } -}, session_storage) +}""", session_storage) ``` ```csharp @@ -314,7 +314,7 @@ from playwright.async_api import async_playwright async def main(): async with async_playwright() as p: user_data_dir = '/path/to/directory' - browser = await p.chromium.launch_persistent_context(userDataDir, headless=False) + browser = await p.chromium.launch_persistent_context(user_data_dir, headless=False) # Execute login steps manually in the browser window asyncio.run(main()) diff --git a/docs/src/ci.md b/docs/src/ci.md index a58b78d7da..94e0f4b847 100644 --- a/docs/src/ci.md +++ b/docs/src/ci.md @@ -259,11 +259,11 @@ public class Example { ``` ```python async -browser = await playwright.chromium.launch(chromiumSandbox=False) +browser = await playwright.chromium.launch(chromium_sandbox=False) ``` ```python sync -browser = playwright.chromium.launch(chromiumSandbox=False) +browser = playwright.chromium.launch(chromium_sandbox=False) ``` ```csharp diff --git a/docs/src/intro-python.md b/docs/src/intro-python.md index 4a31ef8c89..0a8a001783 100644 --- a/docs/src/intro-python.md +++ b/docs/src/intro-python.md @@ -8,13 +8,24 @@ title: "Getting Started" ## Installation -Use pip to install Playwright in your Python project. See [system requirements](#system-requirements). +See [system requirements](#system-requirements). + +### Pip ```bash pip install playwright playwright install ``` +### Conda + +```bash +conda config --add channels conda-forge +conda config --add channels microsoft +conda install playwright +playwright install +``` + These commands download the Playwright package and install browser binaries for Chromium, Firefox and WebKit. To modify this behavior see [installation parameters](./installation.md). ## Usage