Web Page Thumbnails with Python and Mozilla
I been wanting to have an automated way of creating thumbnails of web pages. I did some extensive searching around the web for a solution, and the easiest solution seamed to be to use Python to create a very cut down GTK web browser powered by a embedded version of Mozilla. Its actually simpler than it sounds.
The problem with all the examples I found were they were either broken due to age or lacked the features I wanted. I wanted
- The page size to be configurable.
- The thumbnail size to be configurable.
- Shut down after a certain time if it ends up hanging.
- Able to run from the command line.
I was not interested in doing a whole web page, so I did not make it scroll down and do everything, though I am sure that would be possible if you wanted to.
So with out further ado here is my script. I have only tested it on Linux, but I guess it could work on Windows if Python and GTK along with the gtkMozEmbed was installed.