@helvio/web-screenshot
v2.0.5
Published
Screenshots Pages to PNG
Readme
web-screenshot
A tool to take screenshots of websites headlessly.
Installation
npm install -g @helvio/web-screenshot --unsafe-perm--unsafe-perm is necessary to install puppeteer on your computer.
Usage
$ web-screenshot --help
Usage: screenshot [options]
Options:
-V, --version Output the version number
-b, --batch [file] Loads a file with one set of arguments per line
-u, --url <url> URL (website) to screenshot
-t, --time [s] Number of seconds to wait for page to load (default: 3)
-x, --x [x] Leftmost Pixel (default: 0)
-y, --y [y] Top Pixel (default: 0)
-w, --width [width] Width (default: 1920)
-h, --height [height] Height (default: 1080)
-o, --out [out] Absolute or Relative Path to save the screenshot
-c, --crop Auto crop same-color borders
-d, --debug Prints debug messages and disables headless
-a, --auth [auth] NTLM Credentials in `username:password` format
--help display help for commandTips
- For batch mode, each line should contain one set of arguments, such as:
-u https://google.com -x 700 -y 900 -w 700 -h 180 -o google_logo_png --crop- Lines that begin with # will be ignored (comments)
- You can call web-screenshot with the URL only, such as
web-screenshot -u github.com. - The program will append
http://to your URL and save the output file asgithub.com.png. - If
widthorheightare0, a Full Page screenshot is taken. - The base viewport is
1920x1080. - After the ScreenShot is taken, the borders can be cropped using
--crop. Powered by Sharp. - You can screenshot just a rectangle (or clip) of a webpage by providing
x,y,wandh, such as
web-screenshot -u https://google.com -x 700 -y 190 -w 700 -h 180 -o google_logo.png --cropCoordinates are approximate and you can either use a tool to measure the pixels or trial and error.
The command outputs the image:
google_logo.png

Happy Screenshotting!
