Capture Element

Type: capture_element

Returns the innerHTML, essentially the contents, of a particular element on the page. This can be used when you are only interested in the contents of a particular element.

Parameters

Name
Type
Required
Description

selector

string

The selector that defines the element whose contents you want to capture.

timeout

integer

The maximum amount of time the browser should wait for the element defined by the selector to appear. Default: 5000 (5s)

See universal parameters.

Usage

Click an element on the page

The following code will wait 1 second for the .page_contents element to appear and return an html file containg the div's innerHTML.

"actions": [
    {
      "type": "capture_element",
      "selector": ".page_contents",
      "timeout": 1000
    }
]

Last updated