This project fetches the DOM of multiple URLs using Puppeteer, validates the HTML, and saves the validation results with detailed error messages in CSV format.
-
Clone the repository:
git clone https://github.com/dudekm/dom-validator.git
-
Navigate to the project directory:
cd dom-validator
-
Install the dependencies:
npm install
The script accepts three parameters from the command line:
- URL list file: A
.txt
file with one URL per line. - Output CSV file: The file where validation results and details will be saved.
- Concurrency: The number of URLs to process concurrently.
https://example.com
https://another-example.com
https://example.org
Once you have installed the dependencies and created your urls.txt
file, you can run the project using the following command:
node index.js <urls.txt> <output.csv> <concurrency>
node index.js urls.txt output.csv 5
The output CSV file will have the following format:
url;status;details
https://example.com;valid;No errors
https://another-example.com;invalid;Line 10, col 5: Element “div” not allowed as child of element “span” (rule: "element-name")