← 返回命令列表

Linux command

pageres 命令

网络

复制后可按需替换文件名、目录或参数。

常用示例

Screenshot a website

pageres [https://example.com]

Specify viewport size

pageres [https://example.com] [1024x768]

Multiple sizes

pageres [https://example.com] [1024x768] [1920x1080]

Crop to viewport

pageres [https://example.com] [1024x768] --crop

Set output filename

pageres [https://example.com] --filename=[screenshot]

Delay before capture

pageres [https://example.com] --delay=[3]

Set output directory

pageres [https://example.com] -d [./screenshots]

Capture a specific element

pageres [https://example.com] --selector=[.header]

Hide an element before capture

pageres [https://example.com] --hide=[.cookie-banner]

说明

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.

参数

-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.

FAQ

What is the pageres command used for?

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.

How do I run a basic pageres example?

Run `pageres [https://example.com]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -d, --dest _DIR_ do in pageres?

Output directory.