1

Possible Duplicate:
How to get a website screenshot in python

"Simple way to capture a webpage screenshot using python!"

I have google'd a little for the subject, but can't find anything useful ...

I need a way to capture screenshots of websites with a Python script from a Debian "server" Linux (no X) .. how is that possible? Is there a simple way?

Community
  • 1
  • 1
pkdkk
  • 3,905
  • 8
  • 44
  • 69
  • 1
    possibile duplicate of http://stackoverflow.com/questions/1197172/how-to-get-a-website-screenshot-in-python and http://stackoverflow.com/questions/713938/how-can-i-generate-a-screenshot-of-a-webpage-using-a-server-side-script – Paolo Moretti Feb 24 '12 at 08:55

1 Answers1

1

Try this http://www.blogs.uni-osnabrueck.de/rotapken/2008/12/03/create-screenshots-of-a-web-page-using-python-and-qtwebkit/

Oh, wait! QWebPage depends an QtGui, and QtGui depends on a running X server (at least on Unix systems). So how can we make use of this on a headless server machine? The answer is Xvfb, a framebuffer based X server, originally designed for testing purposes. Of course, it requires some X-libs and fonts, too (how should a page be rendered without any fonts?), but it does not have so much overhead like the real XOrg-server and don’t need to be running all the time. Just call the script this way:

Hai Phaikawl
  • 1,091
  • 8
  • 11