NEWStandard createTask and in.php APIs. Change the address and you are connected.View API docs
GATESOLVER

Errors and troubleshooting

What does HTTP 403 mean when scraping?

It means the server received your request and decided not to serve it, and in scraping that decision usually comes from bot protection, an IP block, odd headers or a missing session.

The meaning

403 Forbidden is a refusal, not an error in transit. The server, or a firewall in front of it, understood what you asked for and chose not to answer. For ordinary visitors it means "you lack permission". For scrapers it usually means one of four things: a WAF or bot manager flagged the request, the IP is blocked, the headers look wrong, or the page requires a session you do not have. The body of the 403 response often tells you which.

Read the response body first

  • Cloudflare challenge. A page titled "Just a moment..." with Cloudflare scripts is a challenge page served with 403. It can be passed; see getting past Cloudflare checks and the guide on Cloudflare 403.
  • Cloudflare error 1020 or similar. An access rule blocked you. No challenge is offered, so nothing can be solved; change what triggered the rule.
  • AWS WAF. A 403 or 405 with an AWS challenge script means an AWS WAF check; a AWS WAF task returns the aws-waf-token cookie.
  • DataDome. A 403 with a reference to captcha-delivery.com is a DataDome block that offers a slider.
  • Plain server 403. A short generic page from the web server usually means permissions or a missing login.
def classify_403(resp):
    body = resp.text[:4000].lower()
    if "just a moment" in body or "cf-chl" in body:
        return "cloudflare challenge"
    if "error code: 1020" in body or "access denied" in body and "cloudflare" in body:
        return "cloudflare rule block"
    if "captcha-delivery.com" in body:
        return "datadome"
    if "awswaf" in body or "aws-waf-token" in resp.headers.get("set-cookie", ""):
        return "aws waf"
    return "server or permissions"

Fixes by cause

Headers and client

Default library user agents, missing Accept and Accept-Language headers, or headers in an order no browser uses all raise suspicion. Send a full, consistent set that matches a current browser. Some protections also inspect the TLS handshake; plain clients such as Python requests have a distinctive fingerprint, covered under TLS fingerprinting.

IP reputation

If the same request works from your home connection but fails from a server or proxy, the IP is the problem. Try a different IP type or provider, and slow down.

Missing session or referer

Some pages refuse direct visits and expect cookies from an earlier page or a Referer header. Load the parent page first in the same session.

Challenges

When the 403 carries a challenge, solve it, keep the resulting cookie and send it with the same IP and user agent. That turns the 403 into a 200 for the rest of the session.

403 versus 401 and 429

401 means authentication is required or failed: log in or send a valid token. 429 means too many requests: slow down. 403 means refused for a reason the server will not discuss. Getting this right saves time, because the fixes are different, and a wrong diagnosis often makes things worse. For the 429 case, see avoiding 429.

When to stop

Some 403s mean the site does not want automated access to that page at all, for example private areas or content behind terms that forbid scraping. If a page is not public, or the site clearly refuses automation and offers an API, use the API or leave it. Stick to public data and reasonable rates.

Keep a record of every 403

Log the URL, exit IP, user agent, the first few hundred characters of the body and the response headers for each 403. Over a day, patterns appear: one proxy range that fails everywhere, one path that always refuses, a header that triggers a rule. Without that record, every 403 looks the same and you end up changing several things at once without knowing which helped.

Common questions

Why do I get 403 in Python but not in my browser?

The site sees a different client: default headers, a distinct TLS fingerprint, or no cookies from a prior visit.

Can a 403 be solved like a CAPTCHA?

Only when the 403 response is a challenge page. Rule blocks such as Cloudflare 1020 offer nothing to solve.

Does changing the user agent fix 403?

Sometimes, if the default library string was the trigger; often headers, TLS and IP must all look consistent.

Is 403 permanent?

Not necessarily. Many blocks are temporary or tied to one IP, but repeated hammering can make them stick.

What is the difference between 401 and 403?

401 asks for valid authentication; 403 refuses the request even if you are authenticated.

Keep reading