Get Web Snapshot

Gets a snapshot of the web page.

Command availability: IBM RPA SaaS and IBM RPA on premises

Description

Gets a snapshot of a web page and returns the image in a variable.

Script syntax

IBM RPA's proprietary scripting language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.

webSnapshot (Image)=value

Dependencies

Use the Start Browser (webStart) command to start a browser or use the Find Internet Explorer Browser (findBrowser) command to attach the Microsoft Internet Explorer before using Get Web Snapshot (webSnapshot) command.

Output parameter

Designer mode label Script mode name Accepted variable types Description
Image value Image Returns the snapshot obtained from the web page.

Example

Starts the browser and obtains a snapshot of the IBM web page and saves it on the desktop.

defVar --name snapshotIBMPage --type Image
defVar --name desktopPath --type String
// Gets the path of desktop for saving the image.
getSpecialFolder --folder "Desktop" desktopPath=value
// Starts the browser Google Chrome.
webStart --name browser --type "Chrome"
// Navigates to the IBM web page.
webNavigate --url "https://www.ibm.com"
// Gets a snapshot of the IBM web page.
webSnapshot snapshotIBMPage=value
// Closes the browser
webClose --name browser
// Saves the snapshot as a JPEG  file on the desktop, with the name snapshot_IBM, if a file with that name already exists, it will be overwritten.
saveImage --image ${snapshotIBMPage} --directory "${desktopPath}" --file snapshot_IBM --overwrite  --format "Jpeg"