Extract table
Read an HTML table into a Data Table (first row as column names), or chosen columns of any repeated rows (a grid or list) by XPath.
Command in the Browser toolkit · id ooa.browser/extract_table · 10 inputs, 1 output
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Captured object | Dictionary | No | The captured object from Capture or Pick in OneAgentStudio: the element's properties to match (each with use and a match rule: equals, not_equals, contains, starts_with, ends_with, wildcard or regex), search_by (properties, css or xpath), index and iframes. Used instead of the selector when given. | |
| Selector | String | No | table | Selector of the table element, used when no captured object is given. |
| Wait up to (milliseconds) | Number | No | 30000 | How long to wait for the element, in milliseconds. |
| Session | String | No | browser | Session name. |
| Window | Dictionary | No | Which window to act in. Leave empty to use the session's current tab. {"source": "browser", "title": "Invoice * - Shop", "title_match": "wildcard", "url": "...", "url_match": "contains", "browser": "edge"} switches to the first open tab whose title and/or address matches (also in attached browsers, and in one listening on port 9222); {"source": "variable", "variable": "session name"} uses that browser session; {"source": "application", "title": "..."} names a desktop window, which works only when it is a window of an attached browser. Matches: wildcard (default for the title), contains (default for the address), equals or regex; text matches ignore case. Values may use variables. | |
| Lazy load | Boolean | No | false | The page adds rows as you scroll: scroll to the end and read again until no more rows appear. |
| Retries | Number | No | 10 | With lazy_load: the most times to scroll and read again. |
| Retry wait (milliseconds) | Number | No | 1000 | With lazy_load: how long to wait after each scroll for new rows, in milliseconds. |
| Columns | Dictionary | No | Columns to read instead of the whole table: column name to an XPath inside each row (its text, or an attribute such as .//a/@href). | |
| Row XPath | String | No | .//tr[td] | With columns: XPath of the rows inside the table or container; table rows with cells when empty. |
Outputs
| Output | Type | What it is |
|---|---|---|
| table | Table | Table content. |