Install & Compatibility
Where this runs
tested against v0.1.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.9
✕ build_error
✓ 3.9s
94MB installed
● package 94MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Axe
✓ from axe_playwright_python.sync_playwright import Axe
sync_playwright
✓ from playwright.sync_api import sync_playwright
Used for setting up Playwright in synchronous tests.
This quickstart demonstrates how to initialize Axe, launch a Playwright browser, navigate to a page, run an accessibility scan, and print the number of violations. It also includes an example of iterating through detected violations.
from playwright.sync_api import sync_playwright
from axe_playwright_python.sync_playwright import Axe
axe = Axe()
with sync_playwright() as playwright:
browser = playwright.chromium.launch()
page = browser.new_page()
page.goto("https://www.google.com")
results = axe.run(page)
browser.close()
print(f"Found {results.violations_count} violations.")
if results.violations_count > 0:
print("Accessibility violations found:")
for violation in results.violations:
print(f" - {violation['id']}: {violation['description']} (Impact: {violation['impact']})")
print(f" Help: {violation['helpUrl']}")
else:
print("No accessibility violations found.")
Debug
Known issues
breakingPlaywright removed its built-in `page.accessibility` API. Users migrating from older Playwright versions or examples might try to use this deprecated method, leading to `AttributeError` or similar errors.fixUse `axe.run(page)` from `axe-playwright-python` for accessibility scanning.
affects: Playwright versions that removed `page.accessibility` (e.g., v1.30+).
gotchaUpgrades to the underlying `axe-core` JavaScript engine (which `axe-playwright-python` wraps) can lead to changes in the number, type, or severity of reported accessibility violations. This means test results might differ across `axe-playwright-python` versions even if the application under test remains unchanged.fixReview changelogs for `axe-playwright-python` and `axe-core` when upgrading. Consider using snapshot testing or baseline reporting tools if strict violation counts are critical for your CI/CD.
affects: All versions, especially when upgrading `axe-playwright-python` across minor or patch releases that update `axe-core`.
gotchaWhile PyPI classifiers for `axe-playwright-python` indicate compatibility with Python >=3.8, the project's explicit dependencies section specifies `Python >= 3.10`. Users on Python 3.8 or 3.9 might encounter unexpected runtime issues or compatibility problems.fixEnsure your Python environment is version 3.10 or higher to guarantee full compatibility.
affects: <=0.1.7
gotchaDepending on the browser and `axe-core` integration, popup blockers might interfere with `axe.run()` if it attempts to open a new window for analysis. This can lead to the scan failing or hanging.fixEnsure that popup blockers are disabled in the browser context used by Playwright, especially for automated testing environments.
affects: All versions, depends on browser configuration and axe-core behavior.
Upgrade
Version history
0.1.7latest on PyPI · released Dec 1, 2025
Audit
Dependencies
pythonrequiredRequired for running the library.
playwrightrequiredCore dependency for browser automation.