This small utility uses Playwright to capture the page accessibility snapshot and generate a human-readable HTML report that approximates the order a screen reader would encounter the page's accessible elements.
-
Create and activate a Python virtual environment (recommended):
python -m venv .venv; ..venv\Scripts\Activate.ps1
-
Install the dependency and browsers:
pip install -r requirements.txt python -m playwright install
Run the script with a URL and optional output path:
python reading_order.py https://example.com --output example_report.html
Use --headful to open a visible browser during capture for debugging.
On Windows, the GUI uses QtWebEngine. The most reliable setup is a pip-based env with PySide6 wheels.
-
Create or use an env that has QtWebEngine working (example: conda env named
web-qt). -
Run the GUI:
PowerShell:
# Activate your env (example) conda activate web-qt # Launch the GUI python reading_order_gui.py
-
Enter a URL and click Scan.
- Live View shows the page and steps through focusable elements in true keyboard order.
- If the page is empty/iframe-heavy, it will automatically run a Playwright scan and populate the list with a numbered screenshot.
- Save Report runs a background scan and writes an HTML report.
- Playwright's accessibility snapshot is an approximation. Different screen readers might still present a slightly different order depending on platform and heuristics.
- If your environment blocks network access or browsers, run the script on an accessible site or provide a local HTML file via file:// URL.
-
If Live View says QWebEngineView unavailable, ensure PySide6 (pip wheels) is installed in the chosen env.
-
Corporate proxies/SSL interception may block page loads. The GUI sets Chromium flags to accept insecure certs by default.
-
If Playwright browsers were never installed in your env, run:
python -m playwright install