Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Takes screenshots of websites


Website Screenshot

Creates a new webkit window using the QT framework of a specified url and saves a screenshot when the page has finished loading.


From ruby:

ws = :url => ""

Check the docs for additional options.

Command line:

$ website-screenshot -u

You'll probably want to use this library on a webserver. You can easily do so without installing the full X stack by launching it using xvfb:

$ xvfb-run --server-args="-screen 0, 1400x900x24" --size=1400x900 --url= --file=vise.png

Flash and other plugins

If flash or any other plugin is installed it will be used while rendering the page. Locations can be set with environment variables such as $QTWEBKIT_PLUGIN_PATH.


Webkit segfaults on rare occasions killing the entire ruby process with it - that's why I encourage calling the script from the command line.

The basic qt webkit browser doesn't handle multiple redirects very well, for this reason the url is initially discovered using curl. Feel free to fork this and get around the limitation.

Source code

The source code is hosted on Github:

To get WebsiteScreenshot from source:

git clone

Aknowledgements and implementations

This code is the heart of a pet project I wrote in my spare time named

I also wrote a web service which I hope is a good starting point to anyone who implements this code.


This package is licensed under the MIT license and/or the Creative Commons Attribution-ShareAlike.

Something went wrong with that request. Please try again.