Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command line program to create website screenshots (on Linux) [closed]

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, ...).

like image 899
ujh Avatar asked Sep 24 '08 08:09

ujh


1 Answers

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.

#!/bin/sh  # start a server with a specific DISPLAY vncserver :11 -geometry 1024x768  # start firefox in this vnc session firefox --display :11  # read URLs from a data file in a loop count=1 while read url do     # send URL to the firefox session     firefox --display :11 $url      # take a picture after waiting a bit for the load to finish     sleep 5     import -window root image$count.jpg      count=`expr $count + 1` done < url_list.txt  # clean up when done vncserver -kill :11 
like image 82
Shannon Nelson Avatar answered Oct 04 '22 13:10

Shannon Nelson