Download Screenshot


Navigation:  Agent Commands > Capture Commands >

Download Screenshot

The Download Screenshot command extracts a screenshot of the entire webpage or the chosen web element. The command will save the screenshot, save it to the file system or send it to a database - depending on your chosen export target. The web selection path for this command normally points to the document itself, but it could also point to a web element that contains a URL that links to the document.


The figure below shows the Command Properties panel after choosing Download Screenshot from the New Command drop-down:


Download Screenshot Command


Data Fields

If the agent is saving the screenshot to a database, then by default this command will generate two data fields: one for the screenshot data and another for the name of the screenshot. If the agent is saving the screenshot to the file system, the command will generate only one data field containing the full file path to the screenshot.


Command Configuration

The Common tab in the Configure Agent Command panel has two tabs:

File Name tab - contains the name of the downloaded image.

OCR tab - check the box if you want to convert an image into text.


We explain the details of each below.


File Name

The entry in this tab contains the file name. From the drop-down menu, you can choose the HTML attribute that you want to use as the name.


Click the Transformation Script button to enter regular .NET expressions or write a .NET script that will transform the screenshot name to meet your requirements. See the Content Transformation Script topic for more information about content transformation scripts.


Use the Data Value option to specify that an agent data value will be used as file name. The agent data can come from a data provider, an input parameter or captured data.



Using the OCR tab, you have the option to convert the screenshot into text. This tab gives you the option to export both the screenshot file and the converted text, or just the converted text. To convert the screenshot, you'll need to check the box and then enter a script to call an external OCR service. Content Grabber does not include an OCR feature, but allows you to integrate with 3rd party services by using this script feature. For more information, see Image OCR Scripts.


Command Properties

The following properties are available in the Convert Image section in the Properties tab:



Convert to Text

Uses a script to convert the downloaded image to text and exports the text. This can be used for CAPTCHA processing.

Image Conversion Script

A script used to transform the screenshot image into text.

Export Converted Image

Exports the converted screenshot image in addition to the text.


The following properties are available in the File Capture section in the Properties tab:



File Name Transformation Script

A script that transforms the file name.

Export URL

Specifies how to export the file URL.

Use Original File Name

When possible, this property contains the original file name.

Fixed File Extension

Adds a fixed file extension to the file.

File Name Attribute

The web element attribute to use as the file name for the screenshot image file.

Auto Detect File Extension

Automatically detects the file extension of the image file. Uncheck this box if you want the file name transformation script to set the file extension.

Use File Name Data Value

Uses a data value as file name instead of an attribute of the selected web element.

File Name Data Consumer

Specifies the input data to use when Use Data Value as File Name is set to true.


The following properties are available in the HTML Capture section on the Properties tab:



HTML Attribute

The HTML attribute to extract from the selected web element.

Concatenate Multiple Web Elements

Concatenates content if multiple web elements are selected. Only the first web element will be used if this property is set to false.

Concatenate Content Separator

The separator to use between content from multiple web elements. This property is only applicable when Concatenate Multiple Web Elements is set to true.


The following properties are available in the Web Selection section on the Properties tab:




The selection XPath for the chosen web element. See the Web Selection Properties article for more information.


These common properties are also available for this command:

Web Selection Properties

Capture Command Properties

Agent Command Properties