Skip to content

wildcard-dev/helpful-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Helpful Scripts

A collection of helpful automation scripts.

Screenshot Sitemap

Takes screenshots of every page listed in a website's sitemap.xml file.

Installation

npm install

Usage

Basic usage:

node screenshot-sitemap.js https://example.com/sitemap.xml

With options:

# Custom output directory and viewport size
node screenshot-sitemap.js https://example.com/sitemap.xml -o ./my-screenshots -w 1280 -h 720

# Add delay between screenshots (helpful for rate limiting)
node screenshot-sitemap.js https://example.com/sitemap.xml --delay 1000

# Save as JPEG instead of PNG
node screenshot-sitemap.js https://example.com/sitemap.xml --format jpeg

# Capture viewport only (not full page)
node screenshot-sitemap.js https://example.com/sitemap.xml --no-fullpage

# Exclude blog posts and category pages
node screenshot-sitemap.js https://example.com/sitemap.xml --exclude /blogpost --exclude /category

# Exclude multiple patterns (can use -e or --exclude)
node screenshot-sitemap.js https://example.com/sitemap.xml -e /blog -e /tag -e /category

Options

  • --output, -o - Output directory (default: ./screenshots)
  • --width, -w - Viewport width in pixels (default: 1920)
  • --height, -h - Viewport height in pixels (default: 1080)
  • --delay, -d - Delay in milliseconds between screenshots (default: 0)
  • --format, -f - Image format: png or jpeg (default: png)
  • --exclude, -e - Exclude URLs containing this pattern (can be used multiple times)
  • --no-fullpage - Capture viewport only instead of full page

Features

  • ✅ Supports standard sitemap.xml format
  • ✅ Handles sitemap index files (nested sitemaps)
  • ✅ Full page screenshots by default
  • ✅ Configurable viewport size
  • ✅ Rate limiting with delay option
  • ✅ Progress tracking with detailed output
  • ✅ Error handling for failed pages
  • ✅ Sanitized filenames for screenshots

Output

Screenshots are saved with numbered filenames based on the URL:

screenshots/
  1_example_com_page1.png
  2_example_com_page2.png
  3_example_com_blog_article.png
  ...

Requirements

  • Node.js 14 or higher
  • Puppeteer will download Chromium automatically on first install

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors