A
A
anijack2021-04-17 11:24:33
Google Chrome
anijack, 2021-04-17 11:24:33

How to tell headless chrome to take a screenshot with auto-height?

I can take a screenshot of a page using headless chrome, while accurately specifying the dimensions:

chrome --headless --disable-gpu --screenshot --window-size=1920,1080 https://example.com/

How can I make the screenshot height automatically adjust to the actual height of the content? It needs to be something like: --window-size=1920, auto.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karbivnichy, 2021-04-17
@anijackich

The link Getting Started with Headless Chrome says:

If you're looking for full page screenshots, things are a tad more involved. There's a great blog post from David Schnurr that has you covered. Check out Using headless Chrome as an automated screenshot tool .

Therefore, follow the link Using headless Chrome as an automated screenshot tool and read the instructions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question