What is a good command line tool to create screenshots of websites on Linux? I need to automatically generate screenshots of websites without human interaction. The only tool that I found was khtml2png, but I wonder if there are others that aren't based on khtml (i.e. have good JavaScript support, ...).
相关问题
- Is shmid returned by shmget() unique across proces
- how to get running process information in java?
- Error building gcc 4.8.3 from source: libstdc++.so
- Why should we check WIFEXITED after wait in order
- Null-terminated string, opening file for reading
A little more detail might be useful...
Start a firefox (or other browser) in an X session, either on your console or using a vncserver. You can use the
--height
and--width
options to set the size of the window to full screen. Another firefox command can be used to set the URL being displayed in the first firefox window. Now you can grab the screen image with one of several commands, such as the "import" command from the Imagemagick package, or using gimp, or fbgrab, or xv.See Webkit2png.
I think this is what I used in the past.
Edit I discover I haven't used the above, but found this page with reviews of many different programs and techniques.
scrot is a command line tool for taking screenshots. See the man page and this tutorial.
You might also want to look at scripting the browser. There are firefox add-ons that take screenshots such as screengrab (which can capture the entire page if you want, not just the visible bit) and you could then script the browser with greasemonkey to take the screenshots.
I don't know of anything custom built, I'm sure there could be something done with the gecko engine to render to a png file instead of the screen ...
Or, you could fire up firefox in full screen mode in a dedicated VNC server instance and use a screenshot grabber to take the screenshot. Fullscreen = minimal chrome, VNC server instance = no visible UI + you can choose your resolution.
Use xinit with Xvnc as the X server to do this - you'll need to read all the manpages.
Downsides are that the screenshot is always the same size, doesn't resize according to the web page ...
http://khtml2png.sourceforge.net/
The deb file
worked on my Ubuntu after installing libkonq4 ... but you may have to cover other dependencies.
I think javascript support may be better now!
Stephan
Try nice small tool CutyCapt, which depends only on Qt and QtWebkit. ;)