GrabzIt
Tools to Capture and Convert the Web

Take Website Screenshots with PythonPython API

The diagnostics panel can help you debug your code!

GrabzIt's screenshot API is very flexible and can be called from a cronjob, a web page or application. The easiest way to add screenshots and more to your Python application is by following these steps:

  1. Get your free Application Key and Secret.
  2. Download the free Python Demo and Package and try it out.
  3. Find out the basics about how GrabzIt's API works by reading the below overview.

Python API Overview

To use the API you will first need to create an instance of the GrabzItClient class, passing your application key and application secret from your GrabzIt account to the constructor.

import GrabzItClient

# Create the GrabzItClient class
# Replace "APPLICATION KEY", "APPLICATION SECRET" with the values from your account!
grabzIt = GrabzItClient.GrabzItClient("APPLICATION KEY", "APPLICATION SECRET")

Then use one of the SetImageOptions, SetPDFOptions, SetAnimationOptions or SetTableOptions methods to request that the GrabzIt service take a screenshot of the URL passed to it.

# To take a image screenshot
grabzIt.SetImageOptions("http://www.google.com") 	
# Or to take a PDF screenshot
grabzIt.SetPDFOptions("http://www.google.com")
# Or to convert online videos into animated GIF's
grabzIt.SetAnimationOptions("http://www.google.com")
# Or to capture table(s)
grabzIt.SetTableOptions("http://www.google.com")

Finally one of the two following save methods must be used to retrieve the capture. The recommended Save method requires the URL of a handler such as handler.py. This enables the capture to be retrived asynchronously, which stops your app having to wait while a screenshot is created.

grabzIt.Save("http://www.example.com/handler.py") 	

The other save method is the SaveTo method and is synchonous it will force your app to wait while the screenshot is created.

filepath = "images/test.jpg"
grabzIt.SaveTo(filepath) 	

More Options

There are many more options when creating web pages from screenshots including; configuring the browser height, browser width, screenshot height, screenshot width, the delay before a screenshot is taken and the image format of the screenshot. Find all these options and much more in the GrabzIt Client documentation.

Try all our premium features for free with a 3 day free trial. Then from $5.99 a month, unless cancelled.
  • More Captures
  • More Features
  • More API's
  • Bigger Scrapes
  • Bigger Screenshots
  • Bigger Everything
Start Free Trial