Input · Web and APIs

Extract from HTML

Reads pages you already have as HTML in a column, such as a Web Page source's page HTML or stored email bodies, the way the Web Page source reads a page: a table, repeating items, contact details, the text or the links.

Also known as: Scrape stored pages, parse HTML

How it works

HTML column names the column holding each page's HTML, typically page_html from a Web Page source read as Whole page with Keep the HTML too, and Page URL column lets relative links resolve. Read picks the parser: A table (Pick… on the first page), Repeating items (Pick items…), Contact details, Whole page (with Keep the HTML too) or Links, which adds link_text and link_url and can be narrowed with Keep links whose address contains and Only links to the same site. Keep input columns carries chosen input columns onto the result, and every mode adds __source_row pointing back at the input row. The node does not run without an HTML column, or in items mode without picked items.

Inputs and outputs

Inputs

  • data — Table

Outputs

  • data — Table

Settings

The Attributes panel of Extract from HTML, as in the app: the controls work, but nothing runs — there is no data behind it.

The same settings, as the Assistant writes them
{
  htmlColumn: string
  urlColumn?: string
  mode: "table"|"items"|"contacts"|"page"|"links"
  keepColumns?: string[]
  table?: { tableIndex: number, tableCaption?: string, tableHeading?: string }
  items?: { itemSelector: string, fields: { name: string, selector: string, attr: string }[] }
  keepHtml?: boolean
  linkContains?: string
  sameSiteOnly?: boolean
}

htmlColumn = the column holding the pages' HTML (e.g. "page_html"), urlColumn = each page's address, for relative links; items mode adds one column per field (attr "href" = an absolute link, "" = the text), one row per item; page mode adds page_text (+ page_html when keepHtml); links mode adds link_text, link_url; contacts mode adds name, address, city, postal_code, phone, email…; every mode adds __source_row

Example

A store-locator run: Web Page reads 40 store pages as Whole page with the HTML kept; this node, Read: Contact details, turns them into one row per store with address, phone and email, keeping store_name from the input.