MCPcopy
hub / github.com/microsoft/playwright-python

github.com/microsoft/playwright-python @v1.61.0 sqlite

repository ↗ · DeepWiki ↗ · release v1.61.0 ↗
5,658 symbols 32,566 edges 275 files 1,211 documented · 21%
README

🎭 Playwright for Python PyPI Join Discord

Playwright is a Python library to automate Chromium, Firefox and WebKit browsers with a single API. Playwright delivers automation that is ever-green, capable, reliable and fast. See how Playwright is better.

Linux macOS Windows
Chromium 149.0.7827.55
WebKit 26.5
Firefox 151.0

Documentation

https://playwright.dev/python/docs/intro

API Reference

https://playwright.dev/python/docs/api/class-playwright

Example

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    for browser_type in [p.chromium, p.firefox, p.webkit]:
        browser = browser_type.launch()
        page = browser.new_page()
        page.goto('http://playwright.dev')
        page.screenshot(path=f'example-{browser_type.name}.png')
        browser.close()
import asyncio
from playwright.async_api import async_playwright

async def main():
    async with async_playwright() as p:
        for browser_type in [p.chromium, p.firefox, p.webkit]:
            browser = await browser_type.launch()
            page = await browser.new_page()
            await page.goto('http://playwright.dev')
            await page.screenshot(path=f'example-{browser_type.name}.png')
            await browser.close()

asyncio.run(main())

Other languages

More comfortable in another programming language? Playwright is also available in - Node.js (JavaScript / TypeScript), - .NET, - Java.

Core symbols most depended-on inside this repo

evaluate
called by 1488
playwright/_impl/_page.py
goto
called by 1324
playwright/_impl/_page.py
locator
called by 1060
playwright/_impl/_page.py
from_maybe_impl
called by 760
playwright/_impl/_impl_to_api_mapping.py
set_content
called by 613
playwright/_impl/_page.py
to_milliseconds
called by 444
playwright/_impl/_helper.py
_sync
called by 411
playwright/_impl/_sync_base.py
new_page
called by 379
playwright/_impl/_browser.py

Shape

Function 2,986
Method 2,404
Class 254
Route 14

Languages

Python94%
TypeScript6%

Modules by API surface

playwright/sync_api/_generated.py646 symbols
playwright/async_api/_generated.py646 symbols
tests/assets/react/react-dom@16.13.1.production.min.js324 symbols
playwright/_impl/_page.py151 symbols
tests/async/test_page.py140 symbols
playwright/_impl/_network.py122 symbols
tests/async/test_locators.py100 symbols
playwright/_impl/_locator.py100 symbols
tests/async/test_assertions.py93 symbols
tests/sync/test_assertions.py88 symbols
tests/async/test_navigation.py88 symbols
tests/sync/test_locators.py87 symbols

Dependencies from manifests, versioned

greenlet3.2.4 · 1×
pyee13.0.1 · 1×
typing-extensions4.15.0 · 1×

For agents

$ claude mcp add playwright-python \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact