Skip to content

dudekm/dom-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DOM Validator

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.

Prerequisites

  • Node.js (version 20 or higher)
  • npm (comes with Node.js)

Installation

  1. Clone the repository:

    git clone https://github.com/dudekm/dom-validator.git
  2. Navigate to the project directory:

    cd dom-validator
  3. Install the dependencies:

    npm install

Usage

Configuration

The script accepts three parameters from the command line:

  1. URL list file: A .txt file with one URL per line.
  2. Output CSV file: The file where validation results and details will be saved.
  3. Concurrency: The number of URLs to process concurrently.

Example URL list file (urls.txt):

https://example.com
https://another-example.com
https://example.org

Running the project

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>

Example:

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")

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published