The Check Missing Alt Tool is a Python-based utility designed to analyze web pages for <img> and <nuxt-img> tags that are missing or have empty alt attributes. This tool helps developers and content creators ensure their websites are accessible and SEO-friendly by identifying images that lack proper descriptions.
- Dynamic Base URL Input: Users can specify the base URL dynamically when running the tool, making it flexible for different environments (e.g., staging, production).
- Image Categorization: Separates images into two categories:
- Images with the
data-nuxt-imgattribute. - Regular
<img>tags.
- Images with the
- CSV Export: Generates two separate CSV files:
missing_data_nuxt_img.csv: Contains images with thedata-nuxt-imgattribute and missingaltattributes.missing_regular_img.csv: Contains regular<img>tags with missingaltattributes.
- Error Handling: Gracefully handles network errors and invalid URLs.
- Accessibility: Ensures all images have meaningful
altattributes, improving the experience for users relying on screen readers. - SEO Optimization: Helps improve search engine rankings by ensuring images are properly described.
- Content Quality: Identifies gaps in content descriptions, enabling teams to maintain high-quality standards.
- Clone the repository and navigate to the project directory.
- Create a virtual environment and install the required dependencies:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt - Add your URLs to
urls.json. - Run the tool using the
run.shscript:./run.sh
- Enter the base URL when prompted.
- Review the generated CSV files for missing
altattributes.
(venv) root@dev:~/Downloads/check_empty_alts(main)$ ./run.sh
Select an option:
1. Run Check Missing Alt Tool
2. Run Check Semantics Tool
Enter your choice: 2
Enter the BASE_URL (e.g., https://staging-nuxt3.bywinona.com/): https://staging-nuxt3.bywinona.com/The Check Semantics Tool verifies the presence of semantic HTML tags on web pages. It ensures that pages use proper semantic elements for better accessibility and SEO.
Semantic Tags Checked:
<main>: Main content of the page.<header>: Page header.<footer>: Page footer.<article>: Standalone content blocks.<aside>: Complementary content.<nav>: Navigation links.
Features:
- Checks for the presence of semantic tags on each page.
- Exports results to a CSV file for easy review.
Output File:
semantic_check_results.csv: Contains the URLs and a boolean value for each semantic tag indicating its presence or absence.