A comprehensive tool for taking website screenshots and using AI-powered change detection for deployment monitoring and site availability checks.
- πΌοΈ High-quality screenshots using Playwright
- π€ AI-powered change detection using configurable Claude models via Amazon Bedrock Converse API
- π Detailed change reports with severity levels and recommendations
- πΎ Baseline storage with metadata tracking
- π Intelligent analysis of layout, content, styling, and availability changes
- π Organized storage with automatic file naming and JSON reports
Simple command-line tool for taking individual screenshots.
Full-featured monitoring tool with baseline storage and AI comparison.
- Python 3.8+
- AWS Account with Bedrock access
- AWS credentials configured
pip install -r requirements.txtplaywright installOption A - AWS CLI:
aws configureOption B - Environment Variables:
export AWS_ACCESS_KEY_ID="your-access-key"
export AWS_SECRET_ACCESS_KEY="your-secret-key"
export AWS_DEFAULT_REGION="us-east-1"- Go to AWS Bedrock Console
- Navigate to "Model access"
- Request access to Claude models you want to use
- The tool supports multiple Claude models with automatic fallback from inference profile to direct model
Models are configured in models.json file. You can view and customize them:
# See all available models and their capabilities
python screenshot_monitor.py list-models
# Use custom config file
python screenshot_monitor.py list-models --config my-models.jsonDefault models included:
claude-4-sonnet- Latest Sonnet, balanced performance (default)claude-3.5-sonnet- Enhanced analysis capabilitiesclaude-3-opus- Most capable for complex analysisclaude-3-haiku- Fast and cost-effective
# Run the setup test to verify everything is working
python test_setup.py# Take a simple screenshot
python screenshot_tool.py https://example.com
# Specify output filename
python screenshot_tool.py https://google.com my_screenshot.png
# Custom viewport size
python screenshot_tool.py https://github.com --width 1280 --height 720# Auto-generate name from URL (uses default claude-4-sonnet)
python screenshot_monitor.py baseline https://example.com
# Use custom name and model
python screenshot_monitor.py baseline https://example.com --name mysite --model claude-3.5-sonnet
# Custom viewport
python screenshot_monitor.py baseline https://example.com --name mysite --width 1280 --height 720# Compare with stored baseline using specific model
python screenshot_monitor.py compare https://example.com --name mysite --model claude-3-opus
# Auto-detect baseline from URL (uses default model)
python screenshot_monitor.py compare https://example.compython screenshot_monitor.py listpython screenshot_monitor.py list-models# 1. Before deployment - store baseline with high-quality model
python screenshot_monitor.py baseline https://myapp.com --name production --model claude-3-opus
# 2. After deployment - check for changes with same model
python screenshot_monitor.py compare https://myapp.com --name production --model claude-3-opus
# 3. For frequent monitoring, use faster model
python screenshot_monitor.py compare https://myapp.com --name production --model claude-3-haiku============================================================
π CHANGE DETECTION REPORT
============================================================
Site: example_com
URL: https://example.com
Timestamp: 2024-01-15T10:30:45.123456
Baseline: example_com_baseline_a1b2c3d4.png
Current: example_com_current_1705312245.png
------------------------------------------------------------
Changes Detected: π΄ YES
Severity: π MODERATE
Availability: π’ AVAILABLE
π Summary:
Navigation menu layout has changed and there are content updates in the main section
π Changes Found:
1. Type: layout
Description: Navigation menu items have been rearranged
Location: Top navigation bar
Impact: Minor impact on user experience
2. Type: content
Description: Main headline text has been updated
Location: Hero section
Impact: Content refresh, likely intentional
π‘ Recommendations:
β’ Verify navigation changes are intentional
β’ Check if headline update was planned
π Detailed report saved: example_com_report_1705312245.json
============================================================
project/
βββ models.json # Model configuration
βββ screenshot_monitor.py # Main monitoring tool
βββ screenshot_tool.py # Simple screenshot tool
βββ screenshots/
βββ metadata.json # Baseline tracking
βββ example_com_baseline_a1b2c3d4.png # Baseline screenshot
βββ example_com_current_1705312245.png # Current screenshot
βββ example_com_report_1705312245.json # Detailed report
| Option | Default | Description |
|---|---|---|
--model |
from config | Claude model to use for analysis |
--config |
models.json | Path to model configuration file |
--width |
1920 | Viewport width in pixels |
--height |
1080 | Viewport height in pixels |
--storage-dir |
screenshots | Directory for storing files |
--aws-region |
us-east-1 | AWS region for Bedrock |
| Model | Speed | Cost | Analysis Quality | Best For |
|---|---|---|---|---|
claude-3-haiku |
β‘β‘β‘ | π° | βββ | Simple change detection |
claude-3-sonnet |
β‘β‘ | π°π° | ββββ | Balanced performance |
claude-3.5-sonnet |
β‘β‘ | π°π° | βββββ | Enhanced reasoning |
claude-3-opus |
β‘ | π°π°π° | ββββββ | Complex analysis |
claude-4-sonnet |
β‘β‘ | π°π°π° | ββββββ | Latest capabilities |
claude-4-opus |
β‘ | π°π°π°π° | βββββββ | Most advanced |
You can customize the available models by editing models.json:
{
"models": {
"my-custom-model": {
"inference_profile": "us.anthropic.claude-custom-model:0",
"direct": "anthropic.claude-custom-model:0",
"description": "My custom Claude model",
"speed": "fast",
"cost": "low",
"quality": "excellent"
}
},
"default_model": "my-custom-model",
"metadata": {
"version": "1.1",
"last_updated": "2024-01-15"
}
}Required fields for each model:
inference_profile- Bedrock inference profile IDdirect- Direct Bedrock model IDdescription- Human-readable description
Optional fields:
speed,cost,quality- For documentation/selection guidance
The AI analysis detects:
- Layout Changes: Element positioning, sizing, visibility
- Content Changes: Text updates, image changes
- Styling Changes: CSS modifications, color changes
- Functionality Issues: Broken elements, error messages
- Availability Status: Site accessibility and loading issues
- π’ None: No changes detected
- π‘ Minor: Small cosmetic changes
- π Moderate: Noticeable changes that may need review
- π΄ Major: Significant changes affecting functionality
- π¨ Critical: Site errors or complete unavailability
-
AWS Credentials Error
Error: AWS credentials not foundSolution: Configure AWS credentials using
aws configure -
Bedrock Access Denied
Error: Access denied to BedrockSolution: Request access to Claude models in Bedrock console β Model access
-
Model Not Available
Error: Model not found. The inference profile may not be available in your region.Solution: Try a different AWS region (us-east-1, us-west-2) or wait for model availability
-
Inference Profile Error
Invocation of model ID ... with on-demand throughput isn't supportedSolution: The tool automatically falls back to direct model access - this is handled automatically
-
Playwright Browser Error
Error: Browser executable not foundSolution: Run
playwright install -
Large Image Error
Error: Invalid request to BedrockSolution: Reduce viewport size with
--width 1280 --height 720 -
Configuration File Error
Model configuration file 'models.json' not foundSolution: Ensure
models.jsonexists in your working directory or specify custom path with--config -
Invalid Model Configuration
Invalid JSON in configuration fileSolution: Validate your JSON syntax - check for missing commas, quotes, or brackets
- Use appropriate viewport sizes (larger = slower)
- Consider network timeouts for slow-loading sites
- Store baselines in accessible locations for automated scripts
- CI/CD Pipeline: Run comparisons after deployments
- Cron Jobs: Regular site monitoring
- Alerting: Parse JSON reports for automated notifications
- Dashboard: Build monitoring dashboards from report data
- Playwright: Free, runs locally
- Amazon Bedrock: Pay per API call (~$0.003 per 1K tokens)
- Storage: Minimal local storage for screenshots and reports
MIT License - feel free to modify and use for your projects!