Skip to content

Latest commit

 

History

History
84 lines (64 loc) · 3.33 KB

File metadata and controls

84 lines (64 loc) · 3.33 KB

HTML Table Iterator

HTML Table Iterator

Overview

Iterates through tables in HTML content. Parses an HTML source (supplied as raw text or read from a file) and yields one TABLE value per <table> element found, processing tables one at a time for memory efficiency.

Parameters

1. selectMethod (SELECT)

  • Label: Set value via
  • Description: Specifies input method for HTML content.
  • Required: Yes
  • Default: TEXT
  • Constraints: None
  • Options:
    • TEXT (label "TEXT"): Provide HTML content directly as a text string.
    • FILE (label "FILE"): Read HTML content from a file on disk.

1.1.1 htmlText (TEXTAREA) (applicable when selectMethod is TEXT)

  • Label: Set HTML text value
  • Description: HTML content containing tables to iterate.
  • Required: Yes
  • Default: None
  • Constraints: None

1.2.1 filePath (FILE) (applicable when selectMethod is FILE)

  • Label: File path
  • Description: Path to HTML file containing tables to iterate.
  • Required: Yes
  • Default: None
  • Constraints: None

1.2.2 charsetName (SELECT) (applicable when selectMethod is FILE)

  • Label: Character Set
  • Description: Character encoding for file reading.
  • Required: Yes
  • Default: UTF-8
  • Constraints: None
  • Options:
    • UTF-8 (label "UTF-8"): UTF-8 encoding
    • ISO-8859-1 (label "ISO-8859-1"): ISO-8859-1 (Latin-1) encoding
    • US-ASCII (label "US-ASCII"): US-ASCII encoding
    • UTF-16 (label "UTF-16"): UTF-16 encoding (BOM-detected byte order)
    • UTF-16BE (label "UTF-16BE"): UTF-16 big-endian encoding
    • UTF-16LE (label "UTF-16LE"): UTF-16 little-endian encoding
    • UTF-32 (label "UTF-32"): UTF-32 encoding
    • UTF-32BE (label "UTF-32BE"): UTF-32 big-endian encoding
    • UTF-32LE (label "UTF-32LE"): UTF-32 little-endian encoding

2. textType (RADIO)

  • Label: Text formatting options
  • Description: Controls how whitespace is handled in cell text.
  • Required: Yes
  • Default: NORMALIZED_TEXT
  • Constraints: None
  • Options:
    • NORMALIZED_TEXT (label "NORMALIZED (Whitespace is normalized and trimmed)"): Collapses whitespace and trims leading/trailing spaces from each cell value.
    • WHOLE_TEXT (label "WHOLE TEXT (Whitespace is not normalized and not trimmed)"): Preserves whitespace exactly as it appears in the HTML source.

3. extractionType (RADIO)

  • Label: Data extraction options
  • Description: Controls whether to include nested element text in cell data.
  • Required: Yes
  • Default: INCLUDE_CHILDREN
  • Constraints: None
  • Options:
    • INCLUDE_CHILDREN (label "ALL CHILDREN TEXT (All data within table data node)"): Extracts text from the cell element and all its descendant elements.
    • ONLY_SELF (label "OWN TEXT (Only table data node)"): Extracts only the direct text of the cell element, ignoring nested elements.

Output

Iterates over <table> elements found in the HTML content. Each iteration yields a TABLE value containing the headers and rows extracted from that HTML table.

Exceptions

Throws BotCommandException when HTML parsing fails during initialization, when no more tables are available at iteration time, or when an individual table cannot be processed.