Tools to Capture and Convert the Web
GrabzIt's Online Community

Python Grabzit Screenshot tool to S3 with custom name

Ask questions on how to use GrabzIt’s screenshot tool.

Hello how can I specify a custom filename with screenshot being saved to S3?  My code is not working to specify a custom filename.


Here is my code:

from GrabzIt import GrabzItImageOptions
from GrabzIt import GrabzItClient

def get_screenshot(tx_id, filename=None):
    grabzIt = GrabzItClient.GrabzItClient("mykey", "mysecret")

    options = GrabzItImageOptions.GrabzItImageOptions()
    options.format = "jpg"
    options.browserWidth = 650
    options.browserHeight = 715
    options.delay = 1000
    options.requestAs = 1
    if filename:
        options.customId = filename
    options.exportURL = "s3://key:secret@us-east-1/mybucket"

    grabzIt.URLToImage(url, options)




**** Note: the docs say to specify a customId in the options but the output keeps showing up in my S3 bucket with the name of my Grabzit key...?

Asked by Scott Hendrix on the 26th of February 2023

As per the documentation this is not supported:

This is to stop having to handle problems with filename collisions in the different systems. If you would like to change the name there you will need to implement this yourself.

The customid is what is returned to the handler so you can identify a capture.

Answered by GrabzIt Support on the 26th of February 2023