Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Command line webpage screenshot and thumbnail generator
Python
branch: master

This branch is 5 commits ahead, 3 commits behind coderholic:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
README
pywebshot.py

README

PyWebShot
=========

Automatically generate thumbnails for 1 or more websites from the command line. Requires the python-gtkmozembed package (apt-get installpython-gtkmozembed)

Enhanced by:
Meatballs - http://rewtdance.blogspot.com

Ignores SSL certificate warnings and authentication prompts.
Strips javascript by default preventing segmentation faults on some pages.
Importable into other Python modules with pywebshot.take_screenshots(urls) method.
Disabled thumbnails by default and defaults to fullscreen resolution.
Reduced delay before taking snap.

Original Author:
Ben Dowling - http://www.coderholic.com

Usage: pywebshot.py [options] url1 [url2 ... urlN]

Options:
  -h, --help            show this help message and exit
  -r RESOLUTION, --resolution=RESOLUTION
                        Screen resolution at which to capture the webpage
                        (default full screen resolution - 1366x768)
  -t THUMBNAIL_RESOLUTION, --thumb-res=THUMBNAIL_RESOLUTION
                        Thumbnail resolution (default none)
  -d DELAY, --delay=DELAY
                        Delay in seconds to wait after page load before taking
                        the screenshot (default 0.01)
  -f FILENAME, --filename=FILENAME
                        PNG output filename with .png extension, otherwise
                        default is based on url name and given a .png
                        extension
  -p PATH, --path=PATH  Output path (default pwd)
  -j, --allow-jscript   Allow Javascript (default False)


Examples
--------
pywebshot.py google.com
pywebshot.py google.com yahoo.com
cat urls.txt | xargs ./pywebshot.py
pywebshot.py page_with_delayed_content.com -d10

# single url will output to /tmp/shot.png
pywebshot.py -f /tmp/shot.png google.com
# multiple url will output to /tmp/shot-1.png and /tmp/shot-2.png
pywebshot.py -f /tmp/shot.png google.com yahoo.com

# hide windows thanks to: http://www.binarytides.com/blog/take-webpage-screenshot-from-command-line-in-ubuntu-linux/
xvfb-run --server-args="-screen 0, 1024x768x24" python pywebshot.py
Something went wrong with that request. Please try again.