Skip to content

fix(scrape): treat --full-page-screenshot as the screenshot format - #286

Open
breken-ai wants to merge 2 commits into
firecrawl:mainfrom
breken-ai:fix/full-page-screenshot
Open

breken-ai wants to merge 2 commits into
firecrawl:mainfrom
breken-ai:fix/full-page-screenshot

Conversation

@breken-ai

@breken-ai breken-ai commented Sep 26, 2026 •

Copy link
Copy Markdown

What's wrong

--full-page-screenshot goes into the request but not into the output formats. The flag also doesn't replace a plain screenshot format. This causes two failures:

  1. firecrawl scrape https://example.com --full-page-screenshot prints only the markdown. The API returns a screenshot URL, but the CLI never shows it, so the user pays for a screenshot they never see. --screenshot works because handleScrapeCommand adds screenshot to the output formats for that flag only.
  2. firecrawl scrape https://example.com -f screenshot --full-page-screenshot sends formats: ["screenshot", {"type":"screenshot","fullPage":true}]. The v2 scrape schema has the refine You may only specify one screenshot format, so the command fails with that error.

Reproduced against a local fake /v2/scrape that applies the same one-screenshot rule:

$ firecrawl scrape https://example.com --full-page-screenshot --api-url http://127.0.0.1:38471
# Hello
$ firecrawl scrape https://example.com -f screenshot --full-page-screenshot --api-url http://127.0.0.1:38471
Error: You may only specify one screenshot format

Fix

  • executeScrape: when fullPageScreenshot is set, drop a plain screenshot entry before adding { type: 'screenshot', fullPage: true }.
  • handleScrapeCommand: count fullPageScreenshot as a screenshot when choosing the output shape, the same way --screenshot is counted. handleAllScrapeCommand already does this.

After the fix the two commands above print {"markdown":"# Hello","screenshot":"https://…"} and the formatted Screenshot: https://… block.

Tests

Two new cases in src/__tests__/commands/scrape.test.ts:

  • --format markdown,screenshot plus fullPageScreenshot sends exactly one screenshot format.
  • handleScrapeCommand with fullPageScreenshot prints the screenshot URL next to the markdown.

Both fail on main and pass with the fix. pnpm run format:check, pnpm run type-check, pnpm run build and pnpm test (642 tests) pass.


This PR was prepared with an AI coding agent (Claude). I reproduced the bug and checked the fix and tests before opening it.


Summary by cubic

Fixes --full-page-screenshot so the screenshot URL is included in CLI output instead of being silently dropped. The flag now replaces any plain screenshot output format, preventing the "You may only specify one screenshot format" API error.

Written for commit 0140582. Summary will update on new commits.

Review in cubic

`--full-page-screenshot` was added to the request but not to the output
formats, so `firecrawl scrape <url> --full-page-screenshot` printed only
the markdown and dropped the screenshot URL. Combined with
`--format screenshot` it sent two screenshot formats, which the API
rejects with "You may only specify one screenshot format".

The full-page screenshot now replaces a plain `screenshot` format and
counts as a screenshot when choosing the output shape, the same way
`--screenshot` already does.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Shadow auto-approve: would not auto-approve because issues were found.

Fix all with cubic | Re-trigger cubic

Comment thread src/commands/scrape.ts Outdated
Comment thread src/__tests__/commands/scrape.test.ts
Also cover --screenshot together with --full-page-screenshot.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Fixes --full-page-screenshot so the screenshot output format replaces plain screenshot and the CLI prints the returned screenshot URL; the corrected behavior is pinned by new tests and is a focused, clearly beneficial bug fix.

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant