pageres
captures screenshots of websites at specified viewport sizes
TLDR
SYNOPSIS
pageres [options] url [sizes...]
DESCRIPTION
pageres captures screenshots of websites at specified viewport sizes. It's useful for responsive design testing.Multiple viewport sizes can be specified in a single command. Each size produces a separate image.Full-page screenshots capture content below the fold. Cropping limits output to visible viewport.Delays allow JavaScript and animations to complete. Custom CSS can hide or modify elements.Output supports PNG and JPEG formats. Filenames can include URL and size variables.
PARAMETERS
-d, --dest DIR
Output directory.--filename TEMPLATE
Filename template.--delay SECONDS
Delay before screenshot.-c, --crop
Crop image to the specified viewport height (default captures the full scrolling page).--overwrite
Overwrite existing files.--format FORMAT
Image format: png (default) or jpg.--scale FACTOR
Pixel-density scale multiplier.--selector SELECTOR
Capture only the DOM element matching the CSS selector.--hide SELECTOR
Hide elements matching the selector before capture (repeatable).--clickElement SELECTOR
Click the matched element before capture.--css CSS
Inject custom CSS before capture.--cookie COOKIE
Cookie string (repeatable).--header HEADER
HTTP header (repeatable).--username USER
HTTP basic auth username.--password PASS
HTTP basic auth password.--user-agent UA
User agent string.--transparent
Use a transparent background instead of white.--darkMode
Emulate the user's dark color scheme preference.--timeout SECONDS
Request timeout in seconds.-v, --verbose
Print detailed error output.
CAVEATS
Requires headless Chrome/Chromium. JavaScript-heavy sites may need delays. Some sites block automated screenshots.
HISTORY
pageres was created by Sindre Sorhus for responsive design testing. It provides a command-line interface for website screenshot automation.
SEE ALSO
chromium(1), puppeteer(1), shot-scraper(1)
