Skip to content

Script that does full screenshot (including scrolling) from a list of URLs

License

Notifications You must be signed in to change notification settings

davidlahoz/Web-Page-Screenshot-Utility

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web Page Screenshot Utility

License: MIT

This utility is designed to capture screenshots of complete web pages using Puppeteer and a bash/powershell script to automate the process. It allows you to specify input URLs and choose between saving the screenshots with either the title or the URL as the filename.

Features

  • Captures screenshots of web pages.
  • Handles multiple URLs in a batch process.

Dependencies

Node.js and npm

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. npm is a package manager for Node.js modules.

You can install Node.js and npm by following the instructions on the official Node.js website.

Puppeteer

Puppeteer is a Node library that provides a high-level API over the Chrome DevTools Protocol, allowing for automated control over Chrome or Chromium browsers.

You can install Puppeteer via npm using the following command:

npm install -g puppeteer

Info

grab_all.*

These scripts facilitate the execution of the screenshot utility. They accept input parameters to specify the input file containing URLs and the output directory for saving screenshots. By default, the URLs listed in urls.txt are utilized.

There are two versions that do the exact same thing but for different platforms.

  • grab_all.ps1: to be used with Windows-based devices to avoid the hassle of enabling bash
  • grab_all.sh: to be used with Linux/MacOS devices.

grab_url.js

The JavaScript script grab_url.js utilizes Puppeteer to capture screenshots of web pages. It is invoked by the bash script with parameters passed from the command line.

urls.txt

Here you will place the URLs that you want to take a full screenshot.

/output/

Screenshots will be saved there.

Usage

To utilize these scripts:

  1. Place all files in the desired folder.

  2. Edit urls.txt to include the URLs you wish to process.

  3. Run the appropriate platform-specific script:

    • Windows:

      powershell .\grab_all.ps1
      
    • Linux/MacOS:

      bash grab_all.sh
      

    The screenshots will be saved in /output/ as PNG files.

To Do's

  • Implement automatic acceptance of cookies warning message Progress
  • Automatic user/password autofill for protected websites with basic authentication Progress

Workaround: use https://admin:[email protected]/ while adding URLs to urls.txt

  • Enhance prompt output for a more polished appearance Progress

License

This project is licensed under the terms of the MIT License. See the LICENSE file for details.

About

Script that does full screenshot (including scrolling) from a list of URLs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published