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:
# 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>orframeId=<id>targets a specific iframe for a one-shot read- otherwise,
/textinherits the tab’s current frame scope from/frame - if no frame is selected,
/textreads from the top-level document
Output Format
Default output is human-readable text. Use --json for structured output:
pinchtab text # Plain text outputpinchtab text --json # JSON: {"url":"...","title":"...","text":"..."}
pinchtab text # Plain text outputpinchtab text --json # JSON: {"url":"...","title":"...","text":"..."}
Examples
# 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
| Flag | Description |
|---|---|
--selector, -s | Element selector (ref/CSS/XPath/text) |
--frame | Extract from specific iframe by frameId |
--full | Full page innerText instead of Readability |
--raw | Alias for —full |
--json | Output JSON instead of plain text |
--tab | Target specific tab |
API Parameters
| Parameter | Description |
|---|---|
selector | Element selector for text extraction |
ref | Snapshot ref (e.g., e5) |
frameId | Target iframe ID |
mode | raw for innerText, default for Readability |
maxChars | Truncate output |
format | text 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.