Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/udivankin/puppeteer-batch-screenshots
Make screenshots of your websites in batch
https://github.com/udivankin/puppeteer-batch-screenshots
puppeteer screenshot screenshoteer
Last synced: 2 months ago
JSON representation
Make screenshots of your websites in batch
- Host: GitHub
- URL: https://github.com/udivankin/puppeteer-batch-screenshots
- Owner: udivankin
- License: mit
- Created: 2019-05-06T13:46:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-13T21:51:21.000Z (almost 2 years ago)
- Last Synced: 2024-10-09T22:52:44.052Z (3 months ago)
- Topics: puppeteer, screenshot, screenshoteer
- Language: JavaScript
- Size: 221 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Puppeteer-batch-screenshots
Make screenshots of your websites in batch.
Let's say you have to make 100 web page screenshots in a row daily. The most of CLI-enabled screenshot tools allow you to make one single screenshot at a time, which means every time the new Node + Chrome instance gets initialised. This tool saves a good amount of time by batching these tasks.
Tool based on puppeteer.
Installation and Usage:
```shell
npm i -g puppeteer-batch-screenshots
puppeteer-batch-screenshots config.json
```alternatively you can install it as a local dependency
```shell
mkdir my-perfect-screenshoot-tool && cd my-perfect-screenshoot-tool
npm init -y
npm i puppeteer-batch-screenshots
node ./node_modules/puppeteer-batch-screenshots/index.js config.json
```Example config:
```js
[
// You can put multiple tasks here, each carrying custom settings
{
// Viewport width, defaults to 1280
width: 1440,
// Viewport height, defaults to 800
height: 900,
// Whether it shoud make screenshot of the whole page content
fullPage: false,
// Device to emulate, see full list at
// https://pptr.dev/next/api/puppeteer.knowndevices
emulate: 'iPhone 13 Pro Max landscape',
// Auth username and password for HTTP basic auth
auth: 'username;password',
// Number in ms to wait for
waitForTimeout: 500,
// Or alternatively CSS selector (e.g. ".footer") to wait to appear
waitForSelector: 'body',
// CSS selector of element to take screenshot of
element: '#main',
// Each task can have multiple routes
routes: [
{
// Web page URL
url: 'http://example.com/1',
// Output field is being evaluated to enable template literals
// Supported file extensions: PNG, JPEG/JPG and PDF
output: './screenshots/example-1-${new Date().toISOString()}.png',
},
],
},
];
```License
This project is licensed under the MIT License