Take screenshots of websites from command line in Linux
There are several ways to take screenshots in Linux. Most of them produce a WebKit, Gecko (Firefox) or khtml rendered screenshot image. Some of the methods require X session to open a window and take screenshots.
Read how to take screenshots from command line in Windows in this my post.
gnome-screenshot (in Ubuntu Linux)
From the command-line, just type the command
The command will take a screenshot and provide a dialog to save it.
Take the screenshot of the current active window alone:
You can use import command line tool of ImageMagick.
To install ImageMagick on Ubuntu Linux:
apt-get install imagemagick
Use the “-window root” option to take screenshot of the complete screen:
import -window root images/my1.png
wkhtmltopdf is a command line utility that generates a pdf file from a webpage using webkit rendering engine.
The wkhtmltoimage takes a screenshot and saves it as a png image. It uses the webkit rendering engine.
The tool is created by the same team as wkhtmltopdf.
Cannot render flash animations. Sometimes it fails because of unknown reasons showing errors like:
Cutycapt is a utility to take the screenshot of a url, using the webkit rendering engine and save it to an image file.
khtml2png uses the konqueror rendering engine to create screenshots of web pages.
Pywebshot uses python bindings embedded mozilla ( http://www.mozilla.org/unix/gtk-embedding.html )
- a list of tools with the instructions how to install and use them:
- 4 Methods to Take Screenshot Capture in Ubuntu Linux -
Discussions on StackOverflow: