import json import os def generate_json_report(data, output_file="report.json"): """ Generates a JSON report of the site analysis. """ try: with open(output_file, 'w') as f: json.dump(data, f, indent=4) print(f"JSON report generated at {os.path.abspath(output_file)}") except Exception as e: print(f"Error generating JSON report: {e}") def generate_html_report(data, output_file="report.html"): """ Generates an HTML report for the domain scan. """ summary = data['summary'] details = data['details'] html = f"""
Pages Scanned
Total Images Found
Images Missing Alt Text
Try using a residential proxy or a headless browser with stealth plugins to bypass this restriction.
No pages found with missing alt text images! Great job.
" for page in details: html += f"""{page['missing_alt_count']} images missing alt text
| Image Source URL |
|---|
| {img_src} |