This chapter covers the core features and capabilities of Page Speed Auditor.
No installation needed. Just Python 3.10+ (standard library only).
# Copy the script to your project
cp src/page_speed_auditor.py /your/project/
# Or run it directly from this directory
python src/page_speed_auditor.py --help# Audit a live URL
python src/page_speed_auditor.py --url https://example.com
# Audit a local HTML file
python src/page_speed_auditor.py --file examples/sample_page.html
# JSON output for CI/CD integration
python src/page_speed_auditor.py --url https://example.com --format json
# Batch audit multiple URLs
echo "https://example.com
https://example.com/about
https://example.com/contact" > urls.txt
python src/page_speed_auditor.py --input urls.txt
# Use a custom performance budget
python src/page_speed_auditor.py --url https://example.com --budget examples/performance_budget.json
# Save report to file
python src/page_speed_auditor.py --url https://example.com --output report.txtFollow this guide to get Page Speed Auditor up and running in your environment.
Create a JSON file with custom thresholds:
{
"max_html_size": 100000,
"max_resources": 30,
"max_images": 20,
"max_render_blocking": 3,
"max_dom_depth": 15,
"max_response_time_ms": 1000
}The auditor will use these thresholds when scoring. Useful for CI/CD gates.
| Option | Description | Default |
|---|---|---|
--url, -u | URL to fetch and audit | — |
--file | Local HTML file to audit | — |
--input | Text file with URLs (batch mode) | — |
--format, -f | Output format: text, json | text |
--output, -o | Write output to file | stdout |
--budget | Performance budget JSON file | — |
--timeout | HTTP timeout in seconds | 15 |
--verbose, -v | Enable debug logging | false |
One of --url, --file, or --input is required.
The auditor starts at 100 and deducts points for each issue found:
| Issue | Deduction |
|---|---|
| HTML > 500 KB | -15 |
| HTML > 100 KB | -5 |
| 8+ render-blocking resources | -20 |
| 3+ render-blocking resources | -10 |
| Missing viewport meta | -10 |
| TTFB > 3 seconds | -15 |
| TTFB > 1 second | -5 |
| 60+ total resources | -15 |
| DOM depth > 25 | -10 |
| Images missing dimensions | -5 |
Grades: A (90+), B (80+), C (70+), D (60+), F (<60)
Get the full Page Speed Auditor and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.