Skip to main content
Two different things can go wrong, and they’re handled differently: This guide handles both in Python, with a batch where one URL doesn’t exist.

Back off when Spidra asks you to

429 and 503 mean “try again shortly”. Retry with an increasing wait. In the Python SDK they raise SpidraRateLimitError and SpidraServerError:
Don’t retry other 4xx errors unchanged. A 422 (bad input) or 403 (out of credits) fails the same way every time; Errors lists each one.

Find the pages that failed

A batch’s status is completed when every URL is done, including the failed ones, so check each item:
The retry didn’t help, and that’s the point: the page doesn’t exist. Neither the first try nor the retry was charged.

Which failures are worth retrying

Read error: retry_batch_scrape() re-runs only the failed items, with the batch’s original options. Cookies are never stored, so pass them again if the batch used them.

Single scrapes and crawls

  • A scrape that fails answers status: "failed" with an error, and the SDK’s scrape() raises SpidraJobFailedError. Send it again if the reason is temporary.
  • A crawl skips pages that fail and carries on; they’re marked in the results and aren’t charged. A crawl that can’t read its start page fails as a whole, free.

Good to know

  • The SDKs already retry 502, 503 and 504 responses and keep polling through brief network errors.
  • Submitting a lot at once? Stay under the rate limits: 60 scrapes and 20 batches a minute, and up to 10 unfinished scrapes at a time.