Conversation
Adds markdown output to the `get` subcommand. Converts page HTML to markdown using node-html-markdown, preserving links, tables, and code blocks. Defaults to body content, accepts optional selector for specific elements. Usage: browse get markdown # full page body as markdown browse get markdown .article # specific element Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: f3d5b5d The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
No issues found across 4 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant User
participant CLI as CLI (Commander)
participant Exec as executeCommand()
participant SH as Stagehand/Page
participant Browser as Browser (Local/Remote)
participant MD as node-html-markdown
Note over User,MD: NEW: Markdown Extraction Flow
User->>CLI: browse get markdown [selector]
CLI->>Exec: action(what="markdown", selector)
alt Selector provided
Exec->>Exec: resolveSelector(selector)
else No selector
Exec->>Exec: CHANGED: Default to "body"
end
Exec->>SH: deepLocator(target).innerHtml()
Note over SH,Browser: Context: local playwright or remote Browserbase
SH->>Browser: CDP/Playwright: Get innerHTML
Browser-->>SH: HTML string
SH-->>Exec: HTML string
Exec->>MD: NEW: NodeHtmlMarkdown.translate(html)
MD-->>Exec: Markdown string
Exec-->>CLI: { markdown: value }
CLI-->>User: Print Markdown output
|
I think this might do a better as a skill ( |
|
i honestly feel markdown extraction is a scraping primitive in the ai agent era but let's chat more synchronously tomorrow |
Summary
browse get markdown [selector]to convert page HTML to clean markdownnode-html-markdownfor quality conversion (links, tables, code blocks preserved)Usage
Test results
get markdown(body default)get markdown .titleline(selector)Test plan
🤖 Generated with Claude Code