python-webkit2png snippets

How to generate screenshots on Debian Linux with python-webkit2png

Tagged python, python-webkit2png, webkit2png  Languages bash

Install:

apt-get install python-qt4 libqt4-webkit
git clone git://github.com/adamn/python-webkit2png.git
cd python-webkit2png/
python setup.py install

Test:

./webkit2png.py www.google.com

You might get this error:

webkit2png.py: cannot connect to X server

Fix:

# install xvbf
apt-get install xvfb xbase-clients xfonts-base libgtk2.0-0
# start
Xvfb :99 -ac

See details here

Take a screenshot:

./webkit2png.py -o obama.png -x 1024 768 "http://obama.com"

On OSX I would recommend you use Paparazzi