Skip to main content

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​

InputTypeRequiredDefaultWhat it is
Captured objectDictionaryNoThe 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.
SelectorStringNotableSelector of the table element, used when no captured object is given.
Wait up to (milliseconds)NumberNo30000How long to wait for the element, in milliseconds.
SessionStringNobrowserSession name.
WindowDictionaryNoWhich 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 loadBooleanNofalseThe page adds rows as you scroll: scroll to the end and read again until no more rows appear.
RetriesNumberNo10With lazy_load: the most times to scroll and read again.
Retry wait (milliseconds)NumberNo1000With lazy_load: how long to wait after each scroll for new rows, in milliseconds.
ColumnsDictionaryNoColumns 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 XPathStringNo.//tr[td]With columns: XPath of the rows inside the table or container; table rows with cells when empty.

Outputs​

OutputTypeWhat it is
tableTableTable content.