Ever needed to take a full webpage scrolling screenshot on the Mac through the command line?
While there are various approaches to taking full webpage screenshots on a Mac easily with Firefox or another browser, and many ways to take screenshots on the Mac, including taking screenshots from the Terminal, none of the native options are quite as simple for capturing full page screenshots of websites as the simple approach offered on iPhone or iPad. But if you’re a Terminal user, you can accomplish the task pretty easily with a tool called webkit2png.
This is a commonly required task for web developers, designers, project managers, and many others.
How to Take Full Page Screenshots on Mac via Command Line
Using the webkit2png command line tool, you can capture full webpage screenshots on the Mac.
First you’ll need to install Homebrew on the Mac,
brew install webkit2png
Once installation of webkit2png has completed, you can take a full page screenshot with the following syntax in the command line:
webkit2png -F https://osxdaily.com
The -F flag specifies full page.
You can also specify the width of the browser screenshot in pixels by using -W like so:
webkit2png -F -W 1000 https://osxdaily.com
Important note about capturing screenshots of pages with lazy-loading images: If you are taking screenshots of a web page that uses lazy loading to speed up site loading and page speed, which is incredibly common on the modern web, most of the web page images will not be captured in the screenshot. To avoid that, you’d have to use another full page screenshot method on the Mac like what’s available with Firefox, Safari Developer Tools, or using the iPhone/iPad to take full webpage screenshots.
We covered this tool over a decade(!) ago, but the utility has evolved considerably since then, and the need for it has also increased, thus we’re covering it again and a bit more in depth.
Do you have another approach to taking full page screenshots either from Terminal or elsewhere on the Mac? Let us know in the comments.