Skip to content
HTTP errors in web scraping and automation · error message

HTTP: 404 Not Found and soft 404s

Permanent - do not retryHTTP 404Wrong URL or method (404, 405)

Last verified

The exact message
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://example.com/product/123

What it means

404 means the server cannot find anything at that URL. It does not say whether the absence is temporary or permanent; RFC 9110 reserves 410 Gone for resources that are deliberately removed.

Scrapers meet two variants. A real 404 is easy: the status code tells you. A soft 404 is harder: the server returns 200 OK with a page that says "not found" or shows an empty search result, so a script that only checks status codes stores junk. Google's Search documentation uses the same term for these pages. The opposite also happens: some sites return 404 to clients they choose not to serve, so a URL that works in the browser can 404 in a script.

What is not wrong: a 404 is not a network or server failure, and retrying will not help unless the URL itself changes.

What it looks like

r = requests.get(url, timeout=30)
if r.status_code == 404 or "Page not found" in r.text:
    mark_missing(url)   # covers real and soft 404s

Why it happens

  • The URL was built incorrectly (wrong slug, missing trailing slash, wrong locale or ID).
  • The item was removed or moved, and the site has no redirect.
  • The content is rendered by JavaScript from an API, and the HTML route your script requests does not exist server-side.
  • The site returns 200 with an error template (soft 404) instead of a real 404.
  • Region or session-specific URLs only exist for the visitor who generated them.

How to fix it

  1. Open the exact URL from the error in a browser and compare; check for typos, encoding and case.
  2. Look for a canonical link or sitemap entry to find the current URL of moved items.
  3. Detect soft 404s by checking for the site's not-found text or for missing key elements, not only the status code.
  4. Log 404s separately and remove those URLs from future crawls instead of retrying them.
  5. If the site publishes a sitemap or API, use it to enumerate valid URLs.

How to stop it recurring

Generate URLs from sitemaps, feeds or an API rather than by guessing patterns, and validate scraped records (for example, a product page must have a title and price). Track 404 rates per run; a sudden spike usually means the site changed its URL structure.

Official documentation: developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/404. See all HTTP error messages.

Related errors

Definitions

Quick answers

What does "404 Not Found and soft 404s" mean in HTTP?

404 means the server cannot find anything at that URL. It does not say whether the absence is temporary or permanent; RFC 9110 reserves 410 Gone for resources that are deliberately removed. Scrapers meet two variants. A real 404 is easy: the status code tells you.

How do I fix "404 Not Found and soft 404s"?

1. Open the exact URL from the error in a browser and compare; check for typos, encoding and case. 2. Look for a canonical link or sitemap entry to find the current URL of moved items. 3. Detect soft 404s by checking for the site's not-found text or for missing key elements, not only the status code. 4. Log 404s separately and remove those URLs from future crawls instead of retrying them. 5. If the site publishes a sitemap or API, use it to enumerate valid URLs.

Retries and timeouts without writing the loop

Autonoly's HTTP Request node and browser steps have per-node retries, timeouts and continue-on-fail, so a transient 429 or 503 can back off instead of failing the run. It has no proxies or IP rotation: if a site blocks automated traffic, that block applies to Autonoly too.

Also see Error handling in workflows.