Automated web accessibility testing using axe-core engine.
- Python >= 3.10
- selenium >= 4.4.0 or playwright >= 1.25.0
pip install -U axe-core-python
from playwright.sync_api import sync_playwright
from axe_core_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")
result = axe.run(page)
browser.close()
violations = result['violations']
print(f"{len(violations)} violations found.")
For more examples see documentation.