How to Take Screenshots of Webpages via the Command Line
You already know that you can take screenshots from the command line on Mac OS X, and now using a simple tool called webkit2png you can quickly take a screenshot of any webpage from the command line too.
You’ll need to have Safari and Python installed on your Mac (all Macs have Safari and new OS X versions have Python, some may require command line tools), as well as the aforementioned webkit2png tool (link below), then you’ll be able to take screen shots from the command line as follows:
- Get webkit2png at the developers home here if you haven’t done so yet
- Launch Terminal then enter the following:
python /path/to/webkit2png https://osxdaily.com
The screenshots of the webpage then appear in your current working directory where the command is executed, and the entire webpage URL that it’s pointed at will be captured. Neat huh?
You can read more about webkit2png at the developers home.
Of course this is not the only way to take screen shots of entire webpages, and if you’d prefer to stay in the GUI you can use the tool called Paparazzi to capture an entire web page screenshot in OS X as well.