Text

Extract text from the current page or a specific element.

By default, PinchTab runs a Readability-style extraction against the current document. Use full/raw mode when you want document.body.innerText instead.

Element Selection

Extract text from a specific element using a selector:

terminal
# Positional selector argumentpinchtab text "#article-body"pinchtab text "text:Welcome"# Or use --selector flagpinchtab text --selector "#article-body"pinchtab text -s "xpath://div[@class='content']"
# Positional selector argumentpinchtab text "#article-body"pinchtab text "text:Welcome"# Or use --selector flagpinchtab text --selector "#article-body"pinchtab text -s "xpath://div[@class='content']"

Supported selector types: ref (e5), CSS (#id), XPath (xpath://...), text (text:...).

Frame Scope

/text is frame-aware:

  • --frame <id> or frameId=<id> targets a specific iframe for a one-shot read
  • otherwise, /text inherits the tab’s current frame scope from /frame
  • if no frame is selected, /text reads from the top-level document

Output Format

Default output is human-readable text. Use --json for structured output:

terminal
pinchtab text                           # Plain text outputpinchtab text --json                    # JSON: {"url":"...","title":"...","text":"..."}
pinchtab text                           # Plain text outputpinchtab text --json                    # JSON: {"url":"...","title":"...","text":"..."}

Examples

terminal
# Default Readability extractionpinchtab text# Full page text (document.body.innerText)pinchtab text --fullpinchtab text --raw                     # Alias of --full# Extract text from specific elementpinchtab text "#main-content"pinchtab text --selector ".article-body"# One-shot iframe read by frame idpinchtab text --frame FRAME123# API equivalentcurl "http://localhost:9867/text?mode=raw"curl "http://localhost:9867/text?selector=%23article-body"curl "http://localhost:9867/text?frameId=FRAME123&format=text"
# Default Readability extractionpinchtab text# Full page text (document.body.innerText)pinchtab text --fullpinchtab text --raw                     # Alias of --full# Extract text from specific elementpinchtab text "#main-content"pinchtab text --selector ".article-body"# One-shot iframe read by frame idpinchtab text --frame FRAME123# API equivalentcurl "http://localhost:9867/text?mode=raw"curl "http://localhost:9867/text?selector=%23article-body"curl "http://localhost:9867/text?frameId=FRAME123&format=text"

Flags

FlagDescription
--selector, -sElement selector (ref/CSS/XPath/text)
--frameExtract from specific iframe by frameId
--fullFull page innerText instead of Readability
--rawAlias for —full
--jsonOutput JSON instead of plain text
--tabTarget specific tab

API Parameters

ParameterDescription
selectorElement selector for text extraction
refSnapshot ref (e.g., e5)
frameIdTarget iframe ID
moderaw for innerText, default for Readability
maxCharsTruncate output
formattext for plain text response

Use default mode for article-like pages. Use --full / mode=raw for UI-heavy pages such as dashboards, SERPs, grids, pricing tables, or short log panes that Readability may trim away.