LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pageres

captures screenshots of websites at specified viewport sizes

TLDR

Screenshot a website
$ pageres [https://example.com]
copy
Specify viewport size
$ pageres [https://example.com] [1024x768]
copy
Multiple sizes
$ pageres [https://example.com] [1024x768] [1920x1080]
copy
Crop to viewport (default is full page)
$ pageres [https://example.com] [1024x768] --crop
copy
Set output filename
$ pageres [https://example.com] --filename=[screenshot]
copy
Delay before capture
$ pageres [https://example.com] --delay=[3]
copy
Set output directory
$ pageres [https://example.com] -d [./screenshots]
copy
Capture a specific element
$ pageres [https://example.com] --selector=[.header]
copy
Hide an element before capture
$ pageres [https://example.com] --hide=[.cookie-banner]
copy

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

Copied to clipboard
Kai