Parse Table

Type: parse_table

Finds a table on the page with a given selector and then converts the table data into a JSON object.

This action first fins the table headers and converts them into property names by converting them to lower case and replacing non-alphanumeric characters with underscores. It then processes each table row and for each cell is extracts the contents and saves a value. At the moment, all values will be string types.

Parameters

Name
Type
Required
Description

selector

string

The selector that defines the table whose contents you want to parse.

timeout

integer

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

See universal parameters.

Usage

Extract a table on the page

The following code will wait 1 second for the .large_table element to appear and return a JSON file with the headers and rows converted.

"actions": [
    {
      "type": "parse_table",
      "selector": ".large_table",
      "timeout": 1000
    }
]

Last updated