[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"blog-post-ja-walmart-scraping-guide-proxy":3},{"success":4,"payload":5,"related":69,"errors":135},true,{"id":6,"slug":7,"title":8,"excerpt":9,"body_html":10,"meta_title":11,"meta_description":12,"canonical_url":13,"canonical_override":14,"og_title":15,"og_description":16,"og_image_url":17,"faq_json":18,"key_takeaways":34,"allow_index":39,"noindex_google_only":39,"allow_follow":4,"published_at":40,"updated_at":40,"content_updated_at":41,"featured_image_url":17,"featured_image_alt":14,"card_image_url":14,"reading_time_minutes":42,"author":43,"categories":47,"tags":54,"alternates":55,"locale_paths":67,"views":68},92,"walmart-scraping-guide-proxy","Walmartスクレイピング完全ガイド：商品データ取得からAkamai回避まで","Walmartの商品データを安定して取得する実践ガイド。Akamai+PerimeterX対策、__NEXT_DATA__の活用、Marketplace対応、レート制限対応まで解説。","\u003Ch2>なぜWalmartスクレイピングは難しいのか\u003C\u002Fh2>\n\u003Cp>Walmart.comは月間4億4,000万以上の訪問を持つ米国最大級のECプラットフォームです。CPGブランドやリテールインテリジェンスチームにとって、価格・在庫・レビュー・出品者データの継続的な取得は競合分析の生命線です。しかし、WalmartはAkamai Bot ManagerとPerimeterX（現HUMAN）の二重プロテクションを採用しており、素のHTTPリクエストや安価なデータセンタープロキシではすぐにブロックされます。\u003C\u002Fp>\n\u003Cp>本記事では、Walmartの商品カタログ構造を理解し、\u003Ccode>__NEXT_DATA__\u003C\u002Fcode>という隠しJSONを活用する最短ルート、そしてresidential proxyを使った安定したデータ取得パイプラインの構築までを解説します。\u003C\u002Fp>\n\n\u003Ch2>Walmartの商品カタログ構造\u003C\u002Fh2>\n\u003Ch3>商品ページ（Item Pages）\u003C\u002Fh3>\n\u003Cp>Walmartの商品ページは次のURLパターンを持ちます：\u003C\u002Fp>\n\u003Cpre>\u003Ccode>https:\u002F\u002Fwww.walmart.com\u002Fip\u002F{slug}\u002F{itemId}\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>\u003Ccode>itemId\u003C\u002Fcode>は9〜13桁の数値IDで、Walmart内部の主キーです。slug部分はSEO用で、省略してもリダイレクトされます。例：\u003Ccode>https:\u002F\u002Fwww.walmart.com\u002Fip\u002FGreat-Value-Whole-Vitamin-D-Milk\u002F10450109\u003C\u002Fcode>\u003C\u002Fp>\n\n\u003Ch3>カテゴリページ\u003C\u002Fh3>\n\u003Cp>カテゴリツリーは次のような構造です：\u003C\u002Fp>\n\u003Cpre>\u003Ccode>https:\u002F\u002Fwww.walmart.com\u002Fcp\u002Ffood\u002F976759\nhttps:\u002F\u002Fwww.walmart.com\u002Fcp\u002Fhousehold-essentials\u002F1115193\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>各カテゴリページは最大40アイテムを表示し、ページネーションは\u003Ccode>?page=2\u003C\u002Fcode>形式です。ただし、カテゴリページのHTMLはJavaScriptレンダリングに依存する部分が多く、後述の\u003Ccode>__NEXT_DATA__\u003C\u002Fcode>の活用が必須になります。\u003C\u002Fp>\n\n\u003Ch3>検索ページ\u003C\u002Fh3>\n\u003Cp>検索URLパターン：\u003C\u002Fp>\n\u003Cpre>\u003Ccode>https:\u002F\u002Fwww.walmart.com\u002Fsearch?q=organic+milk&amp;page=1&amp;sort=price_low\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>主要クエリパラメータ：\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>q\u003C\u002Fcode> — 検索キーワード\u003C\u002Fli>\n\u003Cli>\u003Ccode>page\u003C\u002Fcode> — ページ番号\u003C\u002Fli>\n\u003Cli>\u003Ccode>sort\u003C\u002Fcode> — \u003Ccode>price_low\u003C\u002Fcode>, \u003Ccode>price_high\u003C\u002Fcode>, \u003Ccode>rating\u003C\u002Fcode>, \u003Ccode>best_seller\u003C\u002Fcode>, \u003Ccode>relevance\u003C\u002Fcode>\u003C\u002Fli>\n\u003Cli>\u003Ccode>affinityOverride\u003C\u002Fcode> — \u003Ccode>default\u003C\u002Fcode>でパーソナライズ無効\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Ch3>APIエンドポイント vs HTML：トレードオフ\u003C\u002Fh3>\n\u003Cp>Walmartには内部APIがありますが、これらは認証付きで頻繁に変更されます。HTMLスクレイピングはフロントエンド変更のリスクがあるものの、\u003Ccode>__NEXT_DATA__\u003C\u002Fcode>を活用すればJSONとして構造化データを取得できるため、実はAPIよりも安定しています。\u003C\u002Fp>\n\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\u003Cth>アプローチ\u003C\u002Fth>\u003Cth>利点\u003C\u002Fth>\u003Cth>欠点\u003C\u002Fth>\u003Cth>推奨度\u003C\u002Fth>\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>内部API直接呼び出し\u003C\u002Ftd>\u003Ctd>構造化済みJSON\u003C\u002Ftd>\u003Ctd>認証・エンドポイント変更リスク高\u003C\u002Ftd>\u003Ctd>★★☆\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>HTML + __NEXT_DATA__\u003C\u002Ftd>\u003Ctd>構造化JSON・フロントエンドと同期\u003C\u002Ftd>\u003Ctd>HTML全体のDLが必要\u003C\u002Ftd>\u003Ctd>★★★\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>HTML + CSS\u002FXPath\u003C\u002Ftd>\u003Ctd>柔軟なセレクタ\u003C\u002Ftd>\u003Ctd>レイアウト変更に弱い\u003C\u002Ftd>\u003Ctd>★☆☆\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>ヘッドレスブラウザ\u003C\u002Ftd>\u003Ctd>JS実行済み\u003C\u002Ftd>\u003Ctd>遅い・コスト高\u003C\u002Ftd>\u003Ctd>★★☆\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n\u003Ch2>Akamai + PerimeterX：Walmartの二重防御\u003C\u002Fh2>\n\u003Cp>Walmartは2つの主要なボット防御システムをデプロイしています：\u003C\u002Fp>\n\n\u003Ch3>Akamai Bot Manager\u003C\u002Fh3>\n\u003Cp>AkamaiはTLSフィンガープリント、HTTP\u002F2フレーム順序、\u003Ccode>Sec-*\u003C\u002Fcode>ヘッダーの整合性を検査します。Pythonの\u003Ccode>requests\u003C\u002Fcode>ライブラリのデフォルトTLSフィンガープリントは即座に検出されます。対策として\u003Ccode>curl_cffi\u003C\u002Fcode>や\u003Ccode>tls-client\u003C\u002Fcode>のようなブラウザTLSフィンガープリントを模倣するライブラリが必要です。\u003C\u002Fp>\n\n\u003Ch3>PerimeterX（HUMAN）\u003C\u002Fh3>\n\u003Cp>PerimeterXは主にクライアントサイドのチャレンジを配信します。\u003Ccode>_px3\u003C\u002Fcode>クッキーとJavaScriptチャレンジを通じて、ブラウザ環境の正当性を検証します。サーバーサイドのみのリクエストではこのクッキーを取得できないため、セッション初期化の工夫が必要です。\u003C\u002Fp>\n\n\u003Ch3>なぜresidential proxyが必要か\u003C\u002Fh3>\n\u003Cp>データセンタープロキシのIPはAkamaiのIPレピュテーションデータベースで即座にフラグが立ちます。residential proxyは実際のISP IPアドレスを使用するため、AkamaiのIPレピュテーションチェックを通過します。Walmartスクレイピングにおいて、residential proxyは「推奨」ではなく「必須」です。\u003C\u002Fp>\n\n\u003Cblockquote>\u003Cp>\u003Cstrong>重要：\u003C\u002Fstrong>Walmartへのリクエストでは、米国のresidential IPを使用してください。海外IPはリダイレクトまたはブロックされる可能性が高いです。\u003C\u002Fp>\u003C\u002Fblockquote>\n\n\u003Ch2>__NEXT_DATA__：最も簡単なパースパス\u003C\u002Fh2>\n\u003Cp>Walmart.comはNext.jsで構築されており、各ページのHTMLに\u003Ccode>&lt;script id=\"__NEXT_DATA__\"&gt;\u003C\u002Fcode>タグとして完全な商品データJSONが埋め込まれています。これはAPIレスポンスと同等の構造化データを含んでいます。\u003C\u002Fp>\n\n\u003Cp>CSSセレクタやXPathでHTMLをパースする必要はありません。\u003Ccode>__NEXT_DATA__\u003C\u002Fcode>を抽出するだけで、価格・在庫・レビュー・出品者情報がすべてJSONとして取得できます。\u003C\u002Fp>\n\n\u003Cp>典型的な\u003Ccode>__NEXT_DATA__\u003C\u002Fcode>の構造（商品ページ）：\u003C\u002Fp>\n\u003Cpre>\u003Ccode>{\n  &quot;props&quot;: {\n    &quot;pageProps&quot;: {\n      &quot;initialData&quot;: {\n        &quot;data&quot;: {\n          &quot;product&quot;: {\n            &quot;itemId&quot;: &quot;10450109&quot;,\n            &quot;name&quot;: &quot;Great Value Whole Vitamin D Milk&quot;,\n            &quot;priceInfo&quot;: {\n              &quot;currentPrice&quot;: { &quot;price&quot;: 3.36, &quot;unitOfMeasure&quot;: &quot;Each&quot; },\n              &quot;priceRangeString&quot;: &quot;$3.36&quot;\n            },\n            &quot;availability&quot;: {\n              &quot;available&quot;: true,\n              &quot;maxQuantity&quot;: 12\n            },\n            &quot;rating&quot;: { &quot;averageRating&quot;: 4.2, &quot;numberOfReviews&quot;: 1847 },\n            &quot;sellerId&quot;: &quot;0&quot;,\n            &quot;sellerName&quot;: &quot;Walmart&quot;\n          }\n        }\n      }\n    }\n  }\n}\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Cp>主要フィールドのXPath \u002F CSSセレクタは不要です。JSONキーをたどるだけ：\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>価格：\u003C\u002Fstrong>\u003Ccode>product.priceInfo.currentPrice.price\u003C\u002Fcode>\u003C\u002Fli>\n\u003Cli>\u003Cstrong>在庫：\u003C\u002Fstrong>\u003Ccode>product.availability.available\u003C\u002Fcode>\u003C\u002Fli>\n\u003Cli>\u003Cstrong>レビュー平均：\u003C\u002Fstrong>\u003Ccode>product.rating.averageRating\u003C\u002Fcode>\u003C\u002Fli>\n\u003Cli>\u003Cstrong>レビュー数：\u003C\u002Fstrong>\u003Ccode>product.rating.numberOfReviews\u003C\u002Fcode>\u003C\u002Fli>\n\u003Cli>出品者ID：\u003Ccode>product.sellerId\u003C\u002Fcode>（\u003Ccode>\"0\"\u003C\u002Fcode> = Walmart直営）\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Ch2>Python実装：__NEXT_DATA__の取得とパース\u003C\u002Fh2>\n\u003Cp>以下のPythonスクリプトは、ProxyHatのresidential proxy経由でWalmart商品ページを取得し、\u003Ccode>__NEXT_DATA__\u003C\u002Fcode>から商品データを抽出します。\u003C\u002Fp>\n\n\u003Ch3>ステップ1：セッションの初期化\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>import json\nimport re\nimport time\nimport random\nfrom curl_cffi import requests as curl_requests\n\n# ProxyHat residential proxy（米国IP）\nPROXY_URL = &quot;http:\u002F\u002Fuser-country-US:PASSWORD@gate.proxyhat.com:8080&quot;\nPROXIES = {&quot;http&quot;: PROXY_URL, &quot;https&quot;: PROXY_URL}\n\n# ブラウザ風ヘッダー\nHEADERS = {\n    &quot;User-Agent&quot;: (\n        &quot;Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) &quot;\n        &quot;AppleWebKit\u002F537.36 (KHTML, like Gecko) &quot;\n        &quot;Chrome\u002F125.0.0.0 Safari\u002F537.36&quot;\n    ),\n    &quot;Accept&quot;: &quot;text\u002Fhtml,application\u002Fxhtml+xml,application\u002Fxml;q=0.9,*\u002F*;q=0.8&quot;,\n    &quot;Accept-Language&quot;: &quot;en-US,en;q=0.9&quot;,\n    &quot;Accept-Encoding&quot;: &quot;gzip, deflate, br&quot;,\n    &quot;Connection&quot;: &quot;keep-alive&quot;,\n}\n\nsession = curl_requests.Session(impersonate=&quot;chrome124&quot;)\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch3>ステップ2：商品データの取得とパース\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>def fetch_product(item_id: str) -&gt; dict:\n    &quot;&quot;&quot;Walmart商品ページから__NEXT_DATA__を取得してパース&quot;&quot;&quot;\n    url = f&quot;https:\u002F\u002Fwww.walmart.com\u002Fip\u002F{item_id}&quot;\n    \n    # ランダムな遅延でレート制限を回避\n    time.sleep(random.uniform(2.0, 5.0))\n    \n    resp = session.get(url, headers=HEADERS, proxies=PROXIES, timeout=30)\n    resp.raise_for_status()\n    \n    # __NEXT_DATA__の抽出\n    match = re.search(\n        r&apos;&lt;script id=&quot;__NEXT_DATA__&quot;[^&gt;]*&gt;(.*?)&lt;\u002Fscript&gt;&apos;,\n        resp.text,\n        re.DOTALL\n    )\n    if not match:\n        raise ValueError(f&quot;__NEXT_DATA__ not found for item {item_id}&quot;)\n    \n    next_data = json.loads(match.group(1))\n    product = next_data[&quot;props&quot;][&quot;pageProps&quot;][&quot;initialData&quot;][&quot;data&quot;][&quot;product&quot;]\n    \n    return {\n        &quot;item_id&quot;: product[&quot;itemId&quot;],\n        &quot;name&quot;: product[&quot;name&quot;],\n        &quot;price&quot;: product[&quot;priceInfo&quot;][&quot;currentPrice&quot;][&quot;price&quot;],\n        &quot;available&quot;: product[&quot;availability&quot;][&quot;available&quot;],\n        &quot;max_quantity&quot;: product[&quot;availability&quot;].get(&quot;maxQuantity&quot;, None),\n        &quot;avg_rating&quot;: product[&quot;rating&quot;][&quot;averageRating&quot;],\n        &quot;review_count&quot;: product[&quot;rating&quot;][&quot;numberOfReviews&quot;],\n        &quot;seller_id&quot;: product.get(&quot;sellerId&quot;, None),\n        &quot;seller_name&quot;: product.get(&quot;sellerName&quot;, &quot;Walmart&quot;),\n    }\n\n# 使用例\nproduct = fetch_product(&quot;10450109&quot;)\nprint(json.dumps(product, indent=2))\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch3>ステップ3：検索結果の一括取得\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>def fetch_search(query: str, page: int = 1) -&gt; list[dict]:\n    &quot;&quot;&quot;Walmart検索結果から商品一覧を取得&quot;&quot;&quot;\n    url = f&quot;https:\u002F\u002Fwww.walmart.com\u002Fsearch?q={query}&amp;page={page}&quot;\n    \n    time.sleep(random.uniform(3.0, 6.0))\n    \n    resp = session.get(url, headers=HEADERS, proxies=PROXIES, timeout=30)\n    resp.raise_for_status()\n    \n    match = re.search(\n        r&apos;&lt;script id=&quot;__NEXT_DATA__&quot;[^&gt;]*&gt;(.*?)&lt;\u002Fscript&gt;&apos;,\n        resp.text,\n        re.DOTALL\n    )\n    if not match:\n        raise ValueError(&quot;__NEXT_DATA__ not found in search results&quot;)\n    \n    next_data = json.loads(match.group(1))\n    \n    # 検索結果の構造は商品ページと異なる\n    search_results = (\n        next_data[&quot;props&quot;][&quot;pageProps&quot;]\n        [&quot;initialData&quot;][&quot;searchResult&quot;]\n        [&quot;itemStacks&quot;][0][&quot;items&quot;]\n    )\n    \n    items = []\n    for item in search_results:\n        items.append({\n            &quot;item_id&quot;: item.get(&quot;id&quot;),\n            &quot;name&quot;: item.get(&quot;name&quot;, &quot;&quot;),\n            &quot;price&quot;: item.get(&quot;price&quot;, {}).get(&quot;current&quot;, None),\n            &quot;avg_rating&quot;: item.get(&quot;rating&quot;, {}).get(&quot;averageRating&quot;),\n            &quot;review_count&quot;: item.get(&quot;rating&quot;, {}).get(&quot;numberOfReviews&quot;),\n        })\n    return items\n\n# 使用例：カテゴリ内の全商品を取得\nall_items = []\nfor page in range(1, 6):  # 最大5ページ\n    items = fetch_search(&quot;organic milk&quot;, page=page)\n    all_items.extend(items)\n    print(f&quot;Page {page}: {len(items)} items fetched&quot;)\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch2>Walmart Marketplace：3P出品者 vs 1Pカタログ\u003C\u002Fh2>\n\u003Cp>Walmart.comの商品は、Walmart直営（1P）とMarketplace出品者（3P）が混在しています。\u003Ccode>__NEXT_DATA__\u003C\u002Fcode>では\u003Ccode>sellerId\u003C\u002Fcode>フィールドで判別できます：\u003C\u002Fp>\n\n\u003Cul>\n\u003Cli>sellerId = \"0\" → Walmart直営（1P）\u003C\u002Fli>\n\u003Cli>sellerId = その他の数値 → Marketplace出品者（3P）\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Ch3>3P出品者データの抽出\u003C\u002Fh3>\n\u003Cp>Marketplace商品の場合、\u003Ccode>__NEXT_DATA__\u003C\u002Fcode>内の\u003Ccode>offers\u003C\u002Fcode>配列に全出品者情報が含まれます：\u003C\u002Fp>\n\u003Cpre>\u003Ccode>def extract_offers(product_data: dict) -&gt; list[dict]:\n    &quot;&quot;&quot;1P\u002F3P出品者情報を抽出&quot;&quot;&quot;\n    offers = product_data.get(&quot;offers&quot;, [])\n    results = []\n    \n    for offer in offers:\n        results.append({\n            &quot;seller_id&quot;: offer.get(&quot;sellerId&quot;),\n            &quot;seller_name&quot;: offer.get(&quot;sellerName&quot;, &quot;&quot;),\n            &quot;price&quot;: offer.get(&quot;priceInfo&quot;, {}).get(&quot;currentPrice&quot;, {}).get(&quot;price&quot;),\n            &quot;available&quot;: offer.get(&quot;availability&quot;, {}).get(&quot;available&quot;, False),\n            &quot;shipping&quot;: offer.get(&quot;shipping&quot;, {}).get(&quot;fulfillmentPrice&quot;, None),\n            &quot;is_walmart_fulfilled&quot;: offer.get(&quot;fulfillment&quot;, {}).get(&quot;isFulfilledByWalmart&quot;, False),\n        })\n    \n    return results\n\n# 3P出品者データは競合価格分析に直結\n# 同一itemIdで複数出品者が存在する場合はoffers配列を確認\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch3>1Pと3Pの分析上の違い\u003C\u002Fh3>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\u003Cth>項目\u003C\u002Fth>\u003Cth>1P（Walmart直営）\u003C\u002Fth>\u003Cth>3P（Marketplace）\u003C\u002Fth>\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>価格戦略\u003C\u002Ftd>\u003Ctd>EDLP（Everyday Low Price）\u003C\u002Ftd>\u003Ctd>出品者ごとに変動\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>在庫データ\u003C\u002Ftd>\u003Ctd>Walmart倉庫在庫\u003C\u002Ftd>\u003Ctd>出品者在庫（リアルタイム性が低い）\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>配送\u003C\u002Ftd>\u003Ctd>Walmart Fulfillment\u003C\u002Ftd>\u003Ctd>出品者配送またはWFS\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>返品ポリシー\u003C\u002Ftd>\u003Ctd>Walmart標準\u003C\u002Ftd>\u003Ctd>出品者ごとに異なる\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>データポイント数\u003C\u002Ftd>\u003Ctd>少ない（1SKU = 1価格）\u003C\u002Ftd>\u003Ctd>多い（1SKU = 複数価格）\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n\u003Cp>CPGブランドにとって、3P出品者の価格はMAP（Minimum Advertised Price）違反の監視に直結します。1P価格だけではなく、3P出品者の価格も継続的にモニタリングする必要があります。\u003C\u002Fp>\n\n\u003Ch2>レート制限対応とスケジューリング\u003C\u002Fh2>\n\u003Cp>Walmartのレート制限はAkamaiによって動的に管理されます。明示的な「1分間にXリクエスト」という公開値はありませんが、実測ベースでのガイドラインがあります：\u003C\u002Fp>\n\n\u003Ch3>実測ベースのレート制限しきい値\u003C\u002Fh3>\n\u003Cul>\n\u003Cli>同一IP・1分間：10〜15リクエストが安全圏。20リクエストを超えるとCAPTCHAまたは403の確率が急増\u003C\u002Fli>\n\u003Cli>同一IP・1時間：200〜300リクエストが上限目安\u003C\u002Fli>\n\u003Cli>検索ページ：商品ページより厳しく、5リクエスト\u002F分が安全圏\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Ch3>推奨スケジューリング戦略\u003C\u002Fh3>\n\u003Cp>大規模なデータ取得では、IPローテーションとリクエスト間隔の両方を管理します：\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode>import time\nimport random\nfrom collections import deque\n\nclass RateLimitedScraper:\n    &quot;&quot;&quot;Walmart向けレート制限対応スクレイパー&quot;&quot;&quot;\n    \n    def __init__(self, max_per_minute=8, max_per_hour=180):\n        self.request_times = deque()\n        self.hour_times = deque()\n        self.max_per_minute = max_per_minute\n        self.max_per_hour = max_per_hour\n    \n    def wait_if_needed(self):\n        &quot;&quot;&quot;レート制限内に収まるよう待機&quot;&quot;&quot;\n        now = time.time()\n        \n        # 1分間の制限チェック\n        while self.request_times and now - self.request_times[0] &gt; 60:\n            self.request_times.popleft()\n        \n        if len(self.request_times) &gt;= self.max_per_minute:\n            sleep_time = 60 - (now - self.request_times[0]) + random.uniform(1, 3)\n            print(f&quot;Rate limit: sleeping {sleep_time:.1f}s&quot;)\n            time.sleep(sleep_time)\n        \n        # 1時間の制限チェック\n        while self.hour_times and now - self.hour_times[0] &gt; 3600:\n            self.hour_times.popleft()\n        \n        if len(self.hour_times) &gt;= self.max_per_hour:\n            sleep_time = 3600 - (now - self.hour_times[0]) + random.uniform(10, 30)\n            print(f&quot;Hourly limit: sleeping {sleep_time:.1f}s&quot;)\n            time.sleep(sleep_time)\n        \n        # ランダムな間隔を追加（ボット検知回避）\n        time.sleep(random.uniform(1.5, 4.0))\n        \n        now = time.time()\n        self.request_times.append(now)\n        self.hour_times.append(now)\n    \n    def fetch_product_safe(self, item_id: str) -&gt; dict:\n        &quot;&quot;&quot;レート制限対応済みの商品取得&quot;&quot;&quot;\n        self.wait_if_needed()\n        return fetch_product(item_id)  # 前述の関数を利用\n\n# 大量商品のバッチ処理\nscraper = RateLimitedScraper(max_per_minute=8, max_per_hour=180)\nitem_ids = [&quot;10450109&quot;, &quot;55864531&quot;, &quot;34890857&quot;]  # 例\n\nfor item_id in item_ids:\n    try:\n        data = scraper.fetch_product_safe(item_id)\n        print(f&quot;✓ {item_id}: ${data[&apos;price&apos;]}&quot;)\n    except Exception as e:\n        print(f&quot;✗ {item_id}: {e}&quot;)\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch3>スティッキーセッションの活用\u003C\u002Fh3>\n\u003Cp>PerimeterXのボット検知は、セッション内での行動パターンも評価します。同じIPで複数リクエストを送る方が、リクエストごとにIPを変えるよりも自然に見えます。ProxyHatのスティッキーセッション機能を使うと、特定のIPを10〜30分間保持できます：\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode># スティッキーセッション付きプロキシ（10〜30分間同じIPを維持）\nSTICKY_PROXY = &quot;http:\u002F\u002Fuser-country-US-sid-mybatch01:PASSWORD@gate.proxyhat.com:8080&quot;\n\n# バッチごとにセッションIDを変更\n# → 各バッチは異なるresidential IPを使用\n# → バッチ内は同じIPで自然な閲覧行動をシミュレート\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Cp>スティッキーセッションの使い分け：\u003C\u002Fp>\n\u003Cul>\n\u003Cli>商品ページの連続取得：スティッキーセッション（1セッション = 1カテゴリの全商品）\u003C\u002Fli>\n\u003Cli>検索ページ：スティッキーセッション（1セッション = 1検索クエリの全ページ）\u003C\u002Fli>\n\u003Cli>長時間のバッチ処理：セッションIDを30分ごとにローテーション\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Ch2>エラーハンドリングとCAPTCHA対応\u003C\u002Fh2>\n\u003Cp>Walmartスクレイピングで遭遇する主なエラー：\u003C\u002Fp>\n\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\u003Cth>ステータスコード\u003C\u002Fth>\u003Cth>原因\u003C\u002Fth>\u003Cth>対応\u003C\u002Fth>\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>403\u003C\u002Ftd>\u003Ctd>Akamaiボット検知\u003C\u002Ftd>\u003Ctd>IP\u002Fセッションを変更してリトライ\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>200 + CAPTCHAページ\u003C\u002Ftd>\u003Ctd>PerimeterXチャレンジ\u003C\u002Ftd>\u003Ctd>IPを変更してリトライ\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>200 + 空の__NEXT_DATA__\u003C\u002Ftd>\u003Ctd>地域制限または在庫なし\u003C\u002Ftd>\u003Ctd>US IPを確認、商品IDを検証\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>429\u003C\u002Ftd>\u003Ctd>レート制限\u003C\u002Ftd>\u003Ctd>指数バックオフでリトライ\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>503\u003C\u002Ftd>\u003Ctd>一時的なサーバーエラー\u003C\u002Ftd>\u003Ctd>30秒〜1分後にリトライ\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n\u003Cp>CAPTCHAページの検出方法：\u003C\u002Fp>\n\u003Cpre>\u003Ccode>def is_captcha_page(html: str) -&gt; bool:\n    &quot;&quot;&quot;PerimeterX CAPTCHAページかどうかを判定&quot;&quot;&quot;\n    captcha_signals = [\n        &quot;px-captcha&quot;,\n        &quot;_px&quot;,\n        &quot;challenge-platform&quot;,\n        &quot;cf-challenge&quot;,  # Cloudflare（Walmartでは稀）\n    ]\n    return any(signal in html.lower() for signal in captcha_signals)\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Cp>Walmartの商品データを安定して取得するには、適切なプロキシインフラが不可欠です。\u003Ca href=\"\u002Fja\u002Fpricing\">ProxyHatのresidential proxyプラン\u003C\u002Fa>は、米国ISP IPでのWalmartアクセスに最適化されています。また、\u003Ca href=\"\u002Fja\u002Fuse-cases\u002Fweb-scraping\">ウェブスクレイピングのユースケース\u003C\u002Fa>ページでは、他のECサイトのスクレイピング事例も確認できます。\u003C\u002Fp>","Walmartスクレイピングガイド：商品データ取得とプロキシ対策 | ProxyHat","Walmartの商品データを安定取得する実践ガイド。Akamai+PerimeterX対策、__NEXT_DATA__活用、residential proxyで価格・在庫データを収集。","\u002Fja\u002Fblog\u002Fwalmart-scraping-guide-proxy",null,"Walmartスクレイピング完全ガイド | ProxyHat","Akamai+PerimeterXを回避し、__NEXT_DATA__から価格・在庫・3P出品者データを抽出するPython実装を解説。","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fai\u002F92.jpg",[19,22,25,28,31],{"question":20,"answer":21},"Walmartスクレイピングにデータセンタープロキシを使えますか？","いいえ。WalmartはAkamai Bot Managerを採用しており、データセンタープロキシのIPは即座に検出・ブロックされます。米国のresidential proxyを使用する必要があります。",{"question":23,"answer":24},"__NEXT_DATA__とは何ですか？","Walmart.comがNext.jsで構築されているため、各ページのHTMLに\u003Cscript id=\"__NEXT_DATA__\">タグとして商品データの完全なJSONが埋め込まれています。このJSONをパースすることで、CSSセレクタを使わずに構造化データを取得できます。",{"question":26,"answer":27},"Walmartの1Pと3P出品者をどうやって見分けますか？","__NEXT_DATA__内のsellerIdフィールドで判別できます。sellerIdが\"0\"の場合はWalmart直営（1P）、それ以外の数値の場合はMarketplace出品者（3P）です。3P商品の場合、offers配列に複数の出品者情報が含まれます。",{"question":29,"answer":30},"Walmartスクレイピングの推奨レート制限は？","1IPあたり8リクエスト\u002F分、180リクエスト\u002F時間が安全圏です。検索ページは商品ページより厳しいため、5リクエスト\u002F分以下に抑えることを推奨します。スティッキーセッションで自然な閲覧パターンをシミュレートすることも重要です。",{"question":32,"answer":33},"PerimeterXのCAPTCHAページに遭遇したらどうすればよいですか？","IPアドレスを変更してリトライしてください。同じIPでCAPTCHAを何度も受けると、そのIPがブラックリストに入る可能性があります。ProxyHatのresidential proxyでIPをローテーションし、リクエスト間隔を広げて再試行してください。",[35,36,37,38],"WalmartはAkamaiとPerimeterXの二重防御を採用しているため、米国のresidential proxyとcurl_cffiによるTLSフィンガープリント模倣が必須です。","HTMLをCSS\u002FXPathでパースする代わりに、Next.jsの埋め込みJSONである__NEXT_DATA__から商品データを抽出するのが最も安定しています。","sellerIdが\"0\"ならWalmart直営（1P）、その他はMarketplace出品者（3P）であり、offers配列から各出品者情報を取得できます。","レート制限を回避するため、1IPあたり1分8リクエスト・1時間180リクエスト程度に抑え、スティッキーセッションを活用して自然な閲覧をシミュレートします。",false,"2026-05-06T14:35:22+00:00","2026-10-03T08:21:23+00:00",11,{"name":44,"slug":45,"bio":46,"avatar_url":14,"website_url":14,"social_links":14},"ProxyHat Team","proxyhat-team","The ProxyHat editorial team covers proxies, web scraping, and data extraction.",[48],{"id":49,"slug":50,"name":51,"description":14,"meta_title":52,"meta_description":53,"parent_id":14},5,"ecommerce","ECサイトと競合分析","ECサイトスクレイピングガイド | ProxyHat ブログ","ECサイトデータのスクレイピング、価格監視、競合分析のガイド。",[],{"ko":56,"pt":57,"tr":58,"de":59,"en":60,"ru":61,"fr":62,"ja":13,"es":63,"pl":64,"it":65,"zh":66,"x-default":60},"\u002Fko\u002Fblog\u002Fwalmart-seukeureiping-gaideu","\u002Fpt\u002Fblog\u002Fguia-raspagem-dados-walmart","\u002Ftr\u002Fblog\u002Fwalmart-veri-cekme-rehberi","\u002Fde\u002Fblog\u002Fwalmart-scrapen-leitfaden","\u002Fblog\u002Fscrape-walmart-product-data","\u002Fru\u002Fblog\u002Fskrejping-walmart-rukovodstvo","\u002Ffr\u002Fblog\u002Fguide-scraping-donnees-walmart","\u002Fes\u002Fblog\u002Fguia-scraping-walmart-datos-producto","\u002Fpl\u002Fblog\u002Fjak-scrapowac-walmart-2025","\u002Fit\u002Fblog\u002Fscraping-walmart-dati-prodotto","\u002Fcn\u002Fblog\u002Fwalmart-scraping-zhinan",{"ko":56,"pt":57,"tr":58,"de":59,"en":60,"ru":61,"fr":62,"ja":13,"es":63,"pl":64,"it":65,"zh":66},69,[70,87,103,119],{"id":71,"slug":72,"title":73,"excerpt":74,"featured_image_url":75,"featured_image_alt":76,"card_image_url":77,"og_image_url":78,"published_at":79,"updated_at":79,"content_updated_at":80,"reading_time_minutes":81,"is_featured":39,"indexable":39,"views":82,"author":83,"categories":84,"tags":86},179,"temu-scrape-price-data-2026","Temuの商品・価格データをスクレイピングする方法（2026年）：プロキシ、アンチボット、隠しJSONの活用","Temuには公開APIがなく、HTMLカードの解析と内部JSONエンドポイントの利用のどちらかを選ぶ必要があります。本記事では、Cloudflare Turnstileや署名付きanti_contentトークンを回避し、residentialプロキシで商品・価格データを安定取得する実装手法を解説します。","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Ftemu-scrape-price-data-2026-master.webp","How to Scrape Temu Product and Price Data in 2026: Proxies, Anti-Bot, and the Hidden JSON","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Ftemu-scrape-price-data-2026-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Ftemu-scrape-price-data-2026-og.webp","2026-07-21T10:05:01+00:00","2026-10-03T08:29:59+00:00",12,220,{"name":44,"slug":45,"bio":46,"avatar_url":14,"website_url":14,"social_links":14},[85],{"id":49,"slug":50,"name":51,"description":14,"meta_title":52,"meta_description":53,"parent_id":14},[],{"id":88,"slug":89,"title":90,"excerpt":91,"featured_image_url":92,"featured_image_alt":93,"card_image_url":94,"og_image_url":95,"published_at":96,"updated_at":96,"content_updated_at":97,"reading_time_minutes":81,"is_featured":39,"indexable":4,"views":98,"author":99,"categories":100,"tags":102},181,"google-shopping-kakaku-sukurepingu-2026","ショッピング検索結果から競合価格をモニタリングする方法（Google Shoppingの例）","Content API for Shoppingは自社商品しか取得できないため、競合価格データにはSERP HTMLのパースが必要です。本ガイドではProxyHatプロキシを使った実装手順、セレクタ、回避策を解説します。","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fgoogle-shopping-kakaku-sukurepingu-2026-master.webp","How to Scrape Google Shopping Prices in 2026: A Practical Guide","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fgoogle-shopping-kakaku-sukurepingu-2026-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fgoogle-shopping-kakaku-sukurepingu-2026-og.webp","2026-07-18T16:05:15+00:00","2026-10-04T01:29:51+00:00",141,{"name":44,"slug":45,"bio":46,"avatar_url":14,"website_url":14,"social_links":14},[101],{"id":49,"slug":50,"name":51,"description":14,"meta_title":52,"meta_description":53,"parent_id":14},[],{"id":104,"slug":105,"title":106,"excerpt":107,"featured_image_url":108,"featured_image_alt":109,"card_image_url":110,"og_image_url":111,"published_at":112,"updated_at":112,"content_updated_at":113,"reading_time_minutes":42,"is_featured":39,"indexable":39,"views":114,"author":115,"categories":116,"tags":118},145,"shein-daisuibo-scraping-2026","2026年のShein大規模スクレイピング：プロキシ活用完全ガイド","Akamai Bot Managerを回避しながらSheinのカタログ・価格・在庫データを大規模に取得する実践ガイド。curl_cffiによるTLS指紋一致、住宅プロキシでのジオターゲティング、ページネーションとバックオフ戦略まで詳解。","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fshein-daisuibo-scraping-2026-master.webp","Scraping Shein at Scale in 2026: A Practical Proxy Guide for Price Intelligence","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fshein-daisuibo-scraping-2026-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fshein-daisuibo-scraping-2026-og.webp","2026-07-17T10:04:35+00:00","2026-10-03T08:21:20+00:00",336,{"name":44,"slug":45,"bio":46,"avatar_url":14,"website_url":14,"social_links":14},[117],{"id":49,"slug":50,"name":51,"description":14,"meta_title":52,"meta_description":53,"parent_id":14},[],{"id":120,"slug":121,"title":122,"excerpt":123,"featured_image_url":124,"featured_image_alt":125,"card_image_url":126,"og_image_url":127,"published_at":128,"updated_at":128,"content_updated_at":129,"reading_time_minutes":81,"is_featured":39,"indexable":39,"views":130,"author":131,"categories":132,"tags":134},147,"bestbuy-kakaku-zaiko-scraping-2026","2026年版 Best Buyの価格と在庫をスクレイピングする方法","Best Buyの公式Products APIは承認制でレート制限が厳しいため、リアルタイム価格と店舗レベル在庫はサイトから取得する必要があります。Akamai Bot Manager対策からUSレジデンシャルプロキシを使った実装まで解説します。","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fbestbuy-kakaku-zaiko-scraping-2026-master.webp","How to Scrape Best Buy Prices and Stock in 2026: Proxies, Selectors & Anti-Bot Workarounds","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fbestbuy-kakaku-zaiko-scraping-2026-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fja\u002Fbestbuy-kakaku-zaiko-scraping-2026-og.webp","2026-07-10T16:04:46+00:00","2026-10-03T23:53:01+00:00",111,{"name":44,"slug":45,"bio":46,"avatar_url":14,"website_url":14,"social_links":14},[133],{"id":49,"slug":50,"name":51,"description":14,"meta_title":52,"meta_description":53,"parent_id":14},[],[]]