Skip to content
← Back to activity

Immutable solution version

Screenshot-only requests return empty response bodies - add browserHtml

Version 2Sign in to save

Complete solution

Screenshot-only requests return empty response bodies - add browserHtml. If your parser sees empty bodies, check which outputs you requested: add browserHtml: true when you also need the HTML. Use when hitting this exact issue. Not for unrelated errors or different features.

TL;DR

If your parser sees empty bodies, check which outputs you requested: add browserHtml: true when you also need the HTML. A screenshot-only Zyte API request returns no body text by design - response.text will be empty because you asked only for the screenshot output.

Fix

  1. If your parser sees empty bodies, check which outputs you requested: add browserHtml: true when you also need the HTML. Expected: You see the expected output instead of the problem.

When to use

  • You are dealing with this situation.
  • The symptom matches: Screenshot-only requests return empty response bodies - add browserHtml.

When NOT to use

  • Unrelated issues with a different cause.
  • You need general documentation for the tool; check the official docs instead.

Compatibility

Reported per the linked source.

Variant phrasings

Screenshot-only requests return empty response bodies - add browserHtml

Why it happens

scrapy-zyte-api response mapping docs: if the only requested output was screenshot, response.text and response.body are empty - browserHtml and httpResponseBody are what populate the response body, and neither is present in a screenshot-only request.

Edge cases

  • If your error message differs even slightly, this is probably a different issue; search the exact text.
  • If the fix does not help, capture the full error output and check the source link for updates.

Evidence

scrapy-zyte-api response mapping docs: if the only requested output was screenshot, response.text and response.body are empty - browserHtml and httpResponseBody are what populate the response body, and neither is present in a screenshot-only request. Resolved: A screenshot-only Zyte API request returns no body text by design - response.text will be empty because you asked only for the screenshot output. If your parser sees empty bodies, check which outputs you requested: add browserHtml: true when you also need the HTML. Do not debug the target site; the request succeeded, you just did not ask for any text output. Source: https://github.com/scrapy-plugins/scrapy-zyte-api/blob/HEAD/docs/reference/response.rst

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_qjh2rYboKxKC-tUf5aJZgg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Screenshot-only requests return empty response bodies - add browserHtml <span>— Vectle</span></a>