← 开源

The process of handling CAPTCHA when extracting public data from Amazon with Oxylabs Amazon Scraper API.

Python
增长势头
+124 小时新增 Star+0.1%
1.75k
Star
4
Fork
+1
本周
3
贡献者
创建于 2024-01-22 · 更新于 2026-12-05 · 今日第 5806 名
主要开发者
README

How to Handle Amazon CAPTCHA When Scraping

Take a look at the process of handling CAPTCHAs when collecting public data from Amazon with Amazon Scraper API. You can find the full guide on our blog.

To evaluate our products before purchasing, you may request a free trial by submitting an inquiry. Free trials are subject to approval and involve no upfront commitment.

Why Amazon shows a CAPTCHA

Amazon serves a CAPTCHA page — usually the "Enter the characters you see below" screen — when a request looks automated rather than human. The usual triggers are:

  • Request rate. Many requests from one IP address in a short window.
  • Datacenter IPs. Address ranges known to belong to hosting providers rather than homes.
  • Thin fingerprints. A request with no browser headers, no cookies and no TLS fingerprint that matches a real browser.
  • Repetition. The same header set and request pattern over and over.

The CAPTCHA is returned with HTTP 200, so a scraper that only checks the status code will happily save the block page as if it were a product page. Check the body for a CAPTCHA form before parsing.

Two ways to handle it are shown below: a plain script that runs into the CAPTCHA, and the Oxylabs API, which rotates residential IPs, renders the page and retries so the CAPTCHA does not appear.

Setting up a simple scraper

This scraper will likely encounter a CAPTCHA.

import requests

custom_headers = {
    "Accept-language": "en-GB,en;q=0.9",
    "Accept-Encoding": "gzip, deflate, br",
    "Cache-Control": "max-age=0",
    "Connection": "keep-alive",
    "User-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Safari/605.1.15",
}

url = "https://www.amazon.com/SAMSUNG-Border-Less-Compatible-Adjustable-LS24AG302NNXZA/dp/B096N2MV3H?ref_=Oct_DLandingS_D_fe3953dd_2"

response = requests.get(url, headers=custom_headers)

with open('with_captcha.html', 'w') as file:
    file.write(response.text)

Using Amazon Scraper API

The API is designed to avoid CAPTCHAs.

import requests
from pprint import pprint


payload = {
    'source': 'amazon',
    'url': 'https://www.amazon.com/dp/B096N2MV3H',
    'parse': True
}

response = requests.request(
    'POST',
    'https://realtime.oxylabs.io/v1/queries',
    auth=('username', 'password'),
    json=payload,
)


pprint(response.json())

with open('without_captcha.json', 'w') as file:
    file.write(response.text)

Practical use cases

Use case Why the CAPTCHA matters
Price monitoring A CAPTCHA page parsed as a product page silently writes empty or wrong prices
Catalogue and ASIN collection Blocked requests leave holes in the catalogue you are building
Review and rating tracking Reviews load behind the same anti-bot layer as the listing
Competitor research at scale Volume is exactly what triggers the block, so it needs handling by design
Scheduled data pipelines An unattended nightly job needs retries to be automatic, not manual

Why choose Oxylabs?

  • CAPTCHAs handled for you: residential IPs, browser-grade fingerprints and JavaScript rendering, so the block page does not appear.
  • Built-in proxy management: a 177M+ rotating proxy pool across 195 countries, so you don't manage IPs yourself.
  • Reliable success rates: built to keep working as the target site's markup and anti-bot defenses change.
  • Structured output on demand: results as clean JSON, HTML or Markdown, instead of parsing raw pages yourself.
  • Pay for results, not attempts: you are charged for successfully delivered results — see pricing.
  • Support around the clock: 24/7 support, trusted by 15,000+ clients globally.

FAQ

Why does Amazon show "Enter the characters you see below"?

Amazon decided the request looked automated. Request rate, a datacenter IP, missing browser headers and a repeating request pattern are the common reasons.

Can I solve the Amazon CAPTCHA automatically?

Solving it is the wrong goal. The better approach is not triggering it: residential IPs, real browser fingerprints, sensible request pacing and retries. The Oxylabs API does this for you.

Does changing the User-Agent fix it?

Rarely on its own. A realistic User-Agent helps, but the IP address, TLS fingerprint and request rate matter more. The simple script above sends full browser headers and is still blocked.

How do I detect a CAPTCHA page in code?

Check the response body, not just the status code — a CAPTCHA page returns HTTP 200. Look for the CAPTCHA form or the phrase in the markup, and retry the request instead of parsing it.

Will slowing my scraper down be enough?

It helps, but a single IP making predictable requests is still identifiable, and slowing down caps how much data you can collect. Rotating residential IPs removes both problems.

Learn more

Final word

Follow our technical documentation for all available API parameters.

In case of any issues, please contact us at support@oxylabs.io

Looking to scrape more other Amazon data? Amazon Scraper, Amazon ASIN Scraper, How to Scrape Amazon Prices, Scraping Amazon Product Data

Contacts

If you have questions or need support, reach out at support@oxylabs.io, through live chat on the Oxylabs Dashboard, or join our Discord community. You can also watch on YouTube and follow Oxylabs on GitHub. For enterprise inquiries, contact your dedicated account manager.

排名相邻

AI Rank iPhone 版

随时追踪 AI 模型榜单

在 App Store 下载