DocsWorkflowsComponentsMachinemachine:extension:list

machine:extension:list

Reads a page's repeated items as rows. It is the read half of paging through a listing. The repetition itself is never here, because a fragment is a flat list of steps and a browser that owns the loop is a browser deciding when to stop. This reads the page it is pointed at and hands the rows back, and the workflow document decides whether there is another page.

Options

NameTypeDescription
urlstringThe page to open before reading; empty reads whatever the matched tab already shows
match_urlstringA substring an open tab's URL must contain for the read to reuse that tab
client_idstringThe extension client to read through, a hint the host may honour; empty leaves the choice of browser to the host
selectorstringThe CSS selector matching the repeated item container, one match per row
fieldsExtractFieldThe named columns read out of each item, each selector resolved inside that item
limitintCaps how many items one read returns, leaving the extension's own bound in place at zero
into[]map[string]anyThe rows collected before this page, which this read appends to
keystringThe column whose value identifies a row, which is what tells a page of rows the run already has from a page of new ones; empty reads every page the budget allows
known[]stringThe key values the caller already holds, so a re-read stops where the listing reaches what is stored rather than paging to the budget
nextObservedPaginationThe control that reaches the following page, which is what machine:extension:observe reports, and which turns this read into a collecting loop
  ↳ kindstringIs the shape the page uses to reach its next batch, one of link, numbered, more, or infinite.
  ↳ selectorstringTargets the control that advances the listing.
  ↳ labelstringIs the control's visible text.
  ↳ urlstringIs the next page's href when the control is a link.
  ↳ pagesintCounts the numbered page links a pager prints, when it prints any.
settlestringThe CSS selector to wait for after reaching a page, defaulting to the item container
budgetintHow many pages the collecting loop may read, this call included
pagesintHow many pages have been read before this one
timeout_msintHow long to wait for the browser before failing the read

Outputs

NameTypeDescription
rows[]map[string]anyEvery row collected so far, this page's appended to whatever arrived in Into
page[]map[string]anyJust this page's rows, in the order the listing carried them
countintHow many rows are collected in total
addedintHow many rows this page contributed, zero meaning the selector matched nothing
fields[]stringThe column names every row carries
emptyboolWhether this page contributed no rows at all, which is what a listing whose markup changed looks like when nothing errors
unseenintHow many of this page's rows carried a key neither the caller nor an earlier page of this run already had. It equals Added wherever no key is named, because a run that cannot identify a row cannot claim to have seen it
pagesintHow many pages have now been read, this one included
budgetintHow many pages are left after this one
moreboolWhether reading another page is worth it, meaning this one carried rows the run did not already have and the budget is not spent. A page that contributed nothing ends the loop, because a listing that keeps answering with an empty page pages forever, and so does a page of rows already held, which is both where an incremental re-read stops and what a pager linking to its own page looks like