[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"blog-post-cn-walmart-scraping-zhinan":3},{"success":4,"payload":5,"related":70,"errors":154},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":40,"noindex_google_only":40,"allow_follow":4,"published_at":41,"updated_at":41,"content_updated_at":42,"featured_image_url":17,"featured_image_alt":14,"card_image_url":14,"reading_time_minutes":43,"author":44,"categories":48,"tags":55,"alternates":56,"locale_paths":68,"views":69},92,"walmart-scraping-zhinan","沃尔玛爬虫实战指南：产品数据抓取、反绕过与调度策略","从 Walmart 商品页结构到 __NEXT_DATA__ 提取、Akamai 反爬绕过、3P\u002F1P 数据区分，再到限速调度——一份面向零售情报团队的全链路实战手册。","\u003Ch2>为什么零售情报团队需要抓取沃尔玛\u003C\u002Fh2>\n\u003Cp>沃尔玛（Walmart.com）是美国最大的电商平台之一，月活超过 4 亿，SKU 数以亿计。对 CPG 品牌、渠道管理团队和定价分析师来说，Walmart 上的 商品价格、库存状态、卖家信息和评分 是日常决策的核心数据源。但 Walmart 的反爬体系——Akamai Bot Manager + PerimeterX（现 Imperva）——让传统数据中心代理几乎无法工作。\u003C\u002Fp>\n\u003Cp>这篇文章从实战角度出发，先讲清楚 Walmart 页面结构，再解释为什么住宅代理是刚需，然后手把手演示如何通过 \u003Ccode>__NEXT_DATA__\u003C\u002Fcode> 提取结构化数据，最后给出限速调度方案。\u003C\u002Fp>\n\n\u003Ch2>Walmart 商品目录结构\u003C\u002Fh2>\n\u003Cp>Walmart 的核心页面类型有三种，每种对应不同的数据获取策略：\u003C\u002Fp>\n\n\u003Ch3>1. 商品详情页（Item Page）\u003C\u002Fh3>\n\u003Cp>URL 格式：\u003C\u002Fp>\n\u003Cpre>\u003Ccode>https:\u002F\u002Fwww.walmart.com\u002Fip\u002F{slug}\u002F{itemId}\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>例如 \u003Ccode>https:\u002F\u002Fwww.walmart.com\u002Fip\u002FApple-AirPods-Pro\u002F204065916\u003C\u002Fcode>。itemId 是唯一标识，slug 变化不影响路由。一个 itemId 可以对应多个 slug（SEO 重定向），但 itemId 不变。\u003C\u002Fp>\n\u003Cp>关键数据点：价格、库存（\u003Ccode>availabilityStatus\u003C\u002Fcode>）、卖家信息、评分、变体（size\u002Fcolor）、配送选项。\u003C\u002Fp>\n\n\u003Ch3>2. 分类页（Category \u002F Shelf Page）\u003C\u002Fh3>\n\u003Cp>URL 格式：\u003C\u002Fp>\n\u003Cpre>\u003Ccode>https:\u002F\u002Fwww.walmart.com\u002Fcp\u002F{category-slug}\u002F{categoryId}\nhttps:\u002F\u002Fwww.walmart.com\u002Fbrowse\u002F{top-category}\u002F{sub-category}\u002F{categoryId}\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>分类页返回商品列表，每页约 40 个商品。适合批量发现 itemId，但分页深度通常被限制在 25 页以内。\u003C\u002Fp>\n\n\u003Ch3>3. 搜索结果页（Search Page）\u003C\u002Fh3>\n\u003Cp>URL 格式：\u003C\u002Fp>\n\u003Cpre>\u003Ccode>https:\u002F\u002Fwww.walmart.com\u002Fsearch?q={keyword}&amp;sort={sort}&amp;page={page}\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>搜索页同样每页约 40 条结果，支持排序（\u003Ccode>price_low\u003C\u002Fcode>, \u003Ccode>price_high\u003C\u002Fcode>, \u003Ccode>best_seller\u003C\u002Fcode>, \u003Ccode>rating\u003C\u002Fcode>）。搜索页的数据也可以从 \u003Ccode>__NEXT_DATA__\u003C\u002Fcode> 中批量提取。\u003C\u002Fp>\n\n\u003Ch2>Akamai + PerimeterX 反爬体系\u003C\u002Fh2>\n\u003Cp>Walmart 使用 Akamai Bot Manager 作为第一道防线，配合 \u003Cstrong>PerimeterX\u003C\u002Fstrong>（现 Imperva Advanced Bot Protection）做行为验证。两者的协作方式：\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Akamai\u003C\u002Fstrong>：在 TLS 握手和 HTTP\u002F2 指纹层面识别自动化请求（JA3\u002FJA4 指纹、HTTP\u002F2 帧时序）。数据中心 IP 段直接被 Akamai 的 \u003Ccode>sensor_data\u003C\u002Fcode> 校验拦截，返回 403 或跳转验证页。\u003C\u002Fli>\n\u003Cli>\u003Cstrong>PerimeterX\u003C\u002Fstrong>：在浏览器端注入 JavaScript 挑战（\u003Ccode>_px\u003C\u002Fcode> cookie），检测 WebDriver 特征、Canvas 指纹、鼠标轨迹。触发时弹出 CAPTCHA 或返回空页面。\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Cblockquote>\u003Cstrong>核心结论\u003C\u002Fstrong>：数据中心代理的 IP 段已被 Akamai 标记，请求成功率通常低于 5%。住宅代理（Residential Proxy）使用真实 ISP 分配的 IP，通过 Akamai 的 IP 信誉检查，成功率可达 90%+。对于搜索页和分类页等高保护页面，\u003Cstrong>移动代理\u003C\u002Fstrong>（Mobile Proxy）效果更佳——Walmart 移动端反爬更宽松。\u003C\u002Fblockquote>\n\n\u003Ch3>代理类型对比\u003C\u002Fh3>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\u003Cth>代理类型\u003C\u002Fth>\u003Cth>商品详情页成功率\u003C\u002Fth>\u003Cth>搜索\u002F分类页成功率\u003C\u002Fth>\u003Cth>平均延迟\u003C\u002Fth>\u003Cth>适用场景\u003C\u002Fth>\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>数据中心代理\u003C\u002Ftd>\u003Ctd>&lt; 5%\u003C\u002Ftd>\u003Ctd>&lt; 1%\u003C\u002Ftd>\u003Ctd>低（~100ms）\u003C\u002Ftd>\u003Ctd>不推荐\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>住宅代理\u003C\u002Ftd>\u003Ctd>85-95%\u003C\u002Ftd>\u003Ctd>70-85%\u003C\u002Ftd>\u003Ctd>中（~800ms）\u003C\u002Ftd>\u003Ctd>商品页、批量抓取\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>移动代理\u003C\u002Ftd>\u003Ctd>95%+\u003C\u002Ftd>\u003Ctd>90%+\u003C\u002Ftd>\u003Ctd>较高（~1.2s）\u003C\u002Ftd>\u003Ctd>搜索页、高频监控\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n\u003Ch2>最简解析路径：\u003Ccode>__NEXT_DATA__\u003C\u002Fcode>\u003C\u002Fh2>\n\u003Cp>Walmart 前端使用 Next.js，服务端渲染时将完整的商品数据序列化为 JSON，嵌入 HTML 的 \u003Ccode>&lt;script id=\"__NEXT_DATA__\"&gt;\u003C\u002Fcode> 标签中。这是 最容易、最稳定 的解析路径——不需要分析 DOM 结构，不依赖 CSS 选择器，数据已经是结构化 JSON。\u003C\u002Fp>\n\n\u003Cp>提取方法只需两步：\u003C\u002Fp>\n\u003Col>\n\u003Cli>请求 HTML 页面\u003C\u002Fli>\n\u003Cli>用正则或 BeautifulSoup 找到 \u003Ccode>&lt;script id=\"__NEXT_DATA__\"&gt;\u003C\u002Fcode>，解析 JSON\u003C\u002Fli>\n\u003C\u002Fol>\n\n\u003Cp>关键 JSON 路径：\u003C\u002Fp>\n\u003Cpre>\u003Ccode># 商品核心数据\n__NEXT_DATA__.props.pageProps.initialData.data.product\n\n# 价格\n...product.priceInfo.currentPrice.price  # 数值\n...product.priceInfo.currentPrice.currencyUnit  # 货币\n\n# 库存状态\n...product.availabilityStatus  # &quot;IN_STOCK&quot; | &quot;OUT_OF_STOCK&quot; | &quot;PREORDER&quot;\n\n# 评分与评论数\n...product.averageRating\n...product.numberOfReviews\n\n# 卖家信息\n...product.sellerId\n...product.sellerName\n...product.walmartMarketplaceOffer  # 3P 标记\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch2>Python 实战：抓取 + 解析 Walmart 商品数据\u003C\u002Fh2>\n\u003Cp>以下示例使用 ProxyHat 住宅代理抓取 Walmart 商品页，提取 \u003Ccode>__NEXT_DATA__\u003C\u002Fcode> 中的核心字段。\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode>import requests\nimport json\nimport re\nimport time\nfrom datetime import datetime\n\nPROXY = &quot;http:\u002F\u002Fuser-country-US:YOUR_PASSWORD@gate.proxyhat.com:8080&quot;\nPROXIES = {&quot;http&quot;: PROXY, &quot;https&quot;: PROXY}\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}\n\ndef fetch_item(item_id: str) -&gt; dict | None:\n    &quot;&quot;&quot;抓取 Walmart 商品页并提取 __NEXT_DATA__&quot;&quot;&quot;\n    url = f&quot;https:\u002F\u002Fwww.walmart.com\u002Fip\u002Fproduct\u002F{item_id}&quot;\n    try:\n        resp = requests.get(url, headers=HEADERS, proxies=PROXIES, timeout=15)\n        resp.raise_for_status()\n    except requests.RequestException as e:\n        print(f&quot;[ERROR] 请求失败 item={item_id}: {e}&quot;)\n        return None\n\n    # 提取 __NEXT_DATA__ JSON\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        print(f&quot;[WARN] 未找到 __NEXT_DATA__, item={item_id}&quot;)\n        return None\n\n    next_data = json.loads(match.group(1))\n    product = (\n        next_data\n        .get(&quot;props&quot;, {})\n        .get(&quot;pageProps&quot;, {})\n        .get(&quot;initialData&quot;, {})\n        .get(&quot;data&quot;, {})\n        .get(&quot;product&quot;, {})\n    )\n    if not product:\n        print(f&quot;[WARN] product 节点为空, item={item_id}&quot;)\n        return None\n\n    # 提取核心字段\n    price_info = product.get(&quot;priceInfo&quot;, {}).get(&quot;currentPrice&quot;, {})\n    return {\n        &quot;item_id&quot;: item_id,\n        &quot;name&quot;: product.get(&quot;name&quot;, &quot;&quot;),\n        &quot;price&quot;: price_info.get(&quot;price&quot;),\n        &quot;currency&quot;: price_info.get(&quot;currencyUnit&quot;, &quot;USD&quot;),\n        &quot;availability&quot;: product.get(&quot;availabilityStatus&quot;, &quot;&quot;),\n        &quot;rating&quot;: product.get(&quot;averageRating&quot;),\n        &quot;review_count&quot;: product.get(&quot;numberOfReviews&quot;, 0),\n        &quot;seller_id&quot;: product.get(&quot;sellerId&quot;, &quot;&quot;),\n        &quot;seller_name&quot;: product.get(&quot;sellerName&quot;, &quot;&quot;),\n        &quot;is_marketplace&quot;: bool(product.get(&quot;walmartMarketplaceOffer&quot;)),\n        &quot;fetched_at&quot;: datetime.utcnow().isoformat(),\n    }\n\n\n# 批量示例\nif __name__ == &quot;__main__&quot;:\n    items = [&quot;204065916&quot;, &quot;55506642&quot;, &quot;368696568&quot;]\n    for item_id in items:\n        result = fetch_item(item_id)\n        if result:\n            print(json.dumps(result, indent=2, ensure_ascii=False))\n        time.sleep(2)  # 限速间隔\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch3>curl 单次测试\u003C\u002Fh3>\n\u003Cp>快速验证代理连通性和 \u003Ccode>__NEXT_DATA__\u003C\u002Fcode> 存在性：\u003C\u002Fp>\n\u003Cpre>\u003Ccode>curl -x http:\u002F\u002Fuser-country-US:YOUR_PASSWORD@gate.proxyhat.com:8080 \\\n  -H &quot;User-Agent: Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\u002F537.36&quot; \\\n  -H &quot;Accept-Language: en-US,en;q=0.9&quot; \\\n  &quot;https:\u002F\u002Fwww.walmart.com\u002Fip\u002FApple-AirPods-Pro\u002F204065916&quot; \\\n  | grep -o &apos;&lt;script id=&quot;__NEXT_DATA__&quot;[^&gt;]*&gt;.*&lt;\u002Fscript&gt;&apos; \\\n  | sed &apos;s\u002F&lt;script id=&quot;__NEXT_DATA__&quot;[^&gt;]*&gt;\u002F\u002F&apos; \\\n  | sed &apos;s\u002F&lt;\\\u002Fscript&gt;\u002F\u002F&apos; \\\n  | python3 -m json.tool | head -50\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch2>Walmart Marketplace：3P vs 1P 数据区分\u003C\u002Fh2>\n\u003Cp>Walmart 上的商品分为两类：1P（Walmart 自营）和 3P（第三方卖家）。2024 年数据显示，Walmart Marketplace 的第三方卖家已超过 15 万，3P 商品占比持续上升。\u003C\u002Fp>\n\n\u003Ch3>如何区分\u003C\u002Fh3>\n\u003Cul>\n\u003Cli>sellerId：1P 商品的 \u003Ccode>sellerId\u003C\u002Fcode> 通常为 \u003Ccode>5BB2BD9B-4C56-4C5D-9F67-2D1559B0E649\u003C\u002Fcode>（Walmart 官方卖家 ID）或类似固定值。3P 商品为各卖家独立 ID。\u003C\u002Fli>\n\u003Cli>walmartMarketplaceOffer：此字段存在且为真，表示 3P 商品。\u003C\u002Fli>\n\u003Cli>offerCount：商品详情页可能展示多个卖家报价（同 itemId 不同 seller），\u003Ccode>__NEXT_DATA__\u003C\u002Fcode> 中的 \u003Ccode>offers\u003C\u002Fcode> 数组包含所有卖家。\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Ch3>3P 数据提取示例\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>def extract_offers(product: dict) -&gt; list[dict]:\n    &quot;&quot;&quot;提取同一 itemId 下的所有卖家报价&quot;&quot;&quot;\n    offers_data = product.get(&quot;offers&quot;, [])\n    results = []\n    for offer in offers_data:\n        results.append({\n            &quot;seller_id&quot;: offer.get(&quot;sellerId&quot;, &quot;&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;availability&quot;: offer.get(&quot;availabilityStatus&quot;, &quot;&quot;),\n            &quot;shipping&quot;: offer.get(&quot;fulfillment&quot;, {}).get(&quot;shippingOptions&quot;, []),\n        })\n    return results\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>相对稳定，变化频率低\u003C\u002Ftd>\u003Ctd>波动大，可能每天多次变化\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>库存数据\u003C\u002Ftd>\u003Ctd>较准确，区域差异小\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>标准流程即可\u003C\u002Ftd>\u003Ctd>部分卖家页有额外反爬\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>数据量\u003C\u002Ftd>\u003Ctd>约 40% SKU\u003C\u002Ftd>\u003Ctd>约 60% SKU 且持续增长\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n\u003Cp>对零售情报团队而言，3P 价格监控是核心需求——因为 3P 卖家的定价直接影响品牌控价（MAP）合规性。建议对 3P 商品设置更高的抓取频率（每 4-6 小时），1P 商品可以降低到每 12-24 小时。\u003C\u002Fp>\n\n\u003Ch2>限速调度策略\u003C\u002Fh2>\n\u003Cp>Walmart 的速率限制并不公开，但根据实测经验：\u003C\u002Fp>\n\u003Cul>\n\u003Cli>单 IP 请求量：同一住宅 IP 每分钟超过 10-15 次请求后，触发 Akamai 挑战概率急剧上升。\u003C\u002Fli>\n\u003Cli>搜索页：比商品详情页更严格，建议单 IP 每分钟不超过 5 次。\u003C\u002Fli>\n\u003Cli>整站维度：Walmart 在 IP 级别做频次统计，短时间爆发式请求（如 1 秒内 10 次）会立即触发封禁。\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Ch3>推荐调度架构\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>import time\nimport random\nfrom collections import deque\n\n# 限速参数\nRATE_LIMITS = {\n    &quot;item_page&quot;: {&quot;max_per_minute&quot;: 10, &quot;min_interval&quot;: 6},   # 秒\n    &quot;search_page&quot;: {&quot;max_per_minute&quot;: 4, &quot;min_interval&quot;: 15},\n    &quot;category_page&quot;: {&quot;max_per_minute&quot;: 5, &quot;min_interval&quot;: 12},\n}\n\nclass RateLimiter:\n    &quot;&quot;&quot;基于滑动窗口的限速器&quot;&quot;&quot;\n    def __init__(self, page_type: str):\n        self.config = RATE_LIMITS[page_type]\n        self.timestamps = deque()\n\n    def wait(self):\n        now = time.time()\n        # 清理超过 60 秒的记录\n        while self.timestamps and now - self.timestamps[0] &gt; 60:\n            self.timestamps.popleft()\n\n        if len(self.timestamps) &gt;= self.config[&quot;max_per_minute&quot;]:\n            sleep_time = 60 - (now - self.timestamps[0]) + random.uniform(0.5, 2)\n            print(f&quot;[RATE] 达到限速，等待 {sleep_time:.1f}s&quot;)\n            time.sleep(sleep_time)\n\n        # 最小间隔 + 随机抖动\n        time.sleep(self.config[&quot;min_interval&quot;] + random.uniform(0, 3))\n        self.timestamps.append(time.time())\n\n\nclass ProxyRotator:\n    &quot;&quot;&quot;ProxyHat 住宅代理轮换器&quot;&quot;&quot;\n    def __init__(self, username: str, password: str):\n        self.base_user = username\n        self.password = password\n        self.session_counter = 0\n\n    def get_proxy(self, country: str = &quot;US&quot;, sticky: bool = False):\n        &quot;&quot;&quot;获取代理配置，sticky=True 时保持同一 IP&quot;&quot;&quot;\n        if sticky:\n            session_id = f&quot;sess{self.session_counter}&quot;\n            user = f&quot;{self.base_user}-country-{country}-sid-{session_id}&quot;\n        else:\n            user = f&quot;{self.base_user}-country-{country}&quot;\n\n        proxy_url = f&quot;http:\u002F\u002F{user}:{self.password}@gate.proxyhat.com:8080&quot;\n        return {&quot;http&quot;: proxy_url, &quot;https&quot;: proxy_url}\n\n    def rotate_session(self):\n        &quot;&quot;&quot;切换到新的 sticky session&quot;&quot;&quot;\n        self.session_counter += 1\n\n\n# 使用示例\nrotator = ProxyRotator(&quot;YOUR_USER&quot;, &quot;YOUR_PASSWORD&quot;)\nitem_limiter = RateLimiter(&quot;item_page&quot;)\n\nfor item_id in [&quot;204065916&quot;, &quot;55506642&quot;, &quot;368696568&quot;]:\n    item_limiter.wait()\n    proxies = rotator.get_proxy(country=&quot;US&quot;, sticky=False)\n    result = fetch_item_with_proxy(item_id, proxies)\n    # ...\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch3>调度最佳实践\u003C\u002Fh3>\n\u003Cul>\n\u003Cli>轮换 IP：每次请求使用不同住宅 IP（ProxyHat 默认行为），避免单 IP 积累请求历史。\u003C\u002Fli>\n\u003Cli>Sticky Session：需要连续请求同一站点的场景（如翻页），使用 \u003Ccode>sid-{id}\u003C\u002Fcode> 参数保持 IP 不变，每 10-15 分钟轮换一次。\u003C\u002Fli>\n\u003Cli>随机抖动：在固定间隔基础上加 0-3 秒随机延迟，模拟人类行为。\u003C\u002Fli>\n\u003Cli>失败退避：遇到 403\u002F429 时，指数退避（2s → 4s → 8s → 16s），同时切换 IP。\u003C\u002Fli>\n\u003Cli>时段分散：将大批量任务分散到不同时段执行，避免集中在整点。\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Ch2>搜索页批量抓取\u003C\u002Fh2>\n\u003Cp>搜索页的 \u003Ccode>__NEXT_DATA__\u003C\u002Fcode> 包含一页约 40 个商品的摘要数据，适合快速发现 itemId 列表：\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode>def extract_search_results(next_data: dict) -&gt; list[dict]:\n    &quot;&quot;&quot;从搜索页 __NEXT_DATA__ 提取商品列表&quot;&quot;&quot;\n    search = (\n        next_data\n        .get(&quot;props&quot;, {})\n        .get(&quot;pageProps&quot;, {})\n        .get(&quot;initialData&quot;, {})\n        .get(&quot;searchResult&quot;, {})\n        .get(&quot;itemStacks&quot;, [{}])\n    )\n    items = []\n    for stack in search:\n        for item in stack.get(&quot;items&quot;, []):\n            items.append({\n                &quot;item_id&quot;: item.get(&quot;id&quot;, &quot;&quot;),\n                &quot;name&quot;: item.get(&quot;name&quot;, &quot;&quot;),\n                &quot;price&quot;: item.get(&quot;price&quot;, {}),\n                &quot;rating&quot;: item.get(&quot;averageRating&quot;),\n                &quot;review_count&quot;: item.get(&quot;numberOfReviews&quot;, 0),\n            })\n    return items\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Cp>注意：搜索页的反爬比商品详情页更严格，建议使用 \u003Ca href=\"\u002Fcn\u002Fuse-cases\u002Fweb-scraping\">住宅或移动代理\u003C\u002Fa>，并将频率控制在每分钟 4 次以内。\u003C\u002Fp>\n\n\u003Ch2>数据合规与伦理考量\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>robots.txt：Walmart 的 \u003Ccode>robots.txt\u003C\u002Fcode> 禁止抓取部分路径（如 \u003Ccode>\u002Fcart\u003C\u002Fcode>, \u003Ccode>\u002Faccount\u003C\u002Fcode>），商品页和搜索页虽未明确禁止，但大规模抓取仍需注意频率。\u003C\u002Fli>\n\u003Cli>服务条款：Walmart ToS 禁止自动化数据采集，商业使用需评估法律风险。\u003C\u002Fli>\n\u003Cli>数据最小化：只抓取业务必需的字段，不存储不必要的数据。\u003C\u002Fli>\n\u003Cli>GDPR\u002FCCPA：如果数据涉及用户生成内容（评论），需遵守隐私法规。\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Cp>如果你正在搭建 Walmart 数据采集管线，可以从 \u003Ca href=\"\u002Fcn\u002Fpricing\">ProxyHat 住宅代理套餐\u003C\u002Fa>开始，结合本文的调度策略快速上线。需要覆盖特定城市或州？查看 \u003Ca href=\"\u002Fcn\u002Flocations\">全球代理位置列表\u003C\u002Fa>，ProxyHat 支持美国 50 州的精准地理位置定位。\u003C\u002Fp>","沃尔玛爬虫实战：产品数据抓取与代理配置 | ProxyHat","详解 Walmart 商品数据抓取：__NEXT_DATA__ 解析、Akamai 反爬绕过、住宅代理配置、3P\u002F1P 区分与限速调度策略。","\u002Fcn\u002Fblog\u002Fwalmart-scraping-zhinan",null,"沃尔玛爬虫实战：数据抓取与反绕过 | ProxyHat","从 Walmart 页面结构到 __NEXT_DATA__ 提取、Akamai 反爬绕过、3P\u002F1P 数据区分，再到限速调度——面向零售情报团队的全链路实战手册。","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog\u002Fai\u002F92.jpg",[19,22,25,28,31],{"question":20,"answer":21},"为什么抓取 Walmart 必须使用住宅代理？","Walmart 使用 Akamai Bot Manager 在 TLS\u002FHTTP 指纹层面识别并拦截数据中心 IP，成功率通常低于 5%。住宅代理使用真实 ISP 分配的 IP，能通过 Akamai 的 IP 信誉检查，成功率可达 85-95%。搜索页等高保护页面建议使用移动代理，成功率可达 90%+。",{"question":23,"answer":24},"Walmart 页面中的 __NEXT_DATA__ 是什么？如何提取？","__NEXT_DATA__ 是 Walmart 前端框架 Next.js 在服务端渲染时嵌入 HTML 的 JSON 数据，包含商品价格、库存、评分、卖家等全部结构化信息。提取方法：用正则匹配 \u003Cscript id=\"__NEXT_DATA__\"> 标签内容，然后用 json.loads 解析，无需解析 DOM。",{"question":26,"answer":27},"如何区分 Walmart 1P 自营和 3P Marketplace 商品？","在 __NEXT_DATA__ 中，检查 product.walmartMarketplaceOffer 字段——如果为真，则为 3P 商品。另外，sellerId 为固定值（如 5BB2BD9B-...）的是 Walmart 自营，其他 sellerId 为第三方卖家。3P 商品的 offers 数组可能包含同一 itemId 下多个卖家的报价。",{"question":29,"answer":30},"抓取 Walmart 的合理请求频率是多少？","实测经验：商品详情页每 IP 每分钟不超过 10 次请求（间隔 ≥6 秒），搜索页每 IP 每分钟不超过 4 次（间隔 ≥15 秒）。建议在固定间隔上叠加 0-3 秒随机抖动，并使用住宅代理轮换 IP。遇到 403\u002F429 时执行指数退避并切换 IP。",{"question":32,"answer":33},"ProxyHat 住宅代理如何配置地理位置定位？","在用户名中添加 country 和 city 参数即可精准定位。例如 user-country-US-region-new_york-city-new_york_city:password@gate.proxyhat.com:8080 定位到纽约，user-country-DE-region-state_of_berlin-city-berlin:password@gate.proxyhat.com:8080 定位到柏林。需要保持同一 IP 会话时，追加 -sid-{id} 参数。",[35,36,37,38,39],"沃尔玛采用 Akamai 与 PerimeterX 双层反爬，数据中心代理成功率极低，必须使用住宅或移动代理。","最稳定的数据提取方式是解析页面内嵌的 __NEXT_DATA__ JSON 标签，无需依赖易变的 CSS 选择器。","通过 sellerId 和 walmartMarketplaceOffer 字段可区分沃尔玛自营（1P）与第三方（3P）商品。","抓取需严格限速，商品页每 IP 每分钟不超过 10 次，搜索页不超过 4 次，并加入随机延迟模拟人类行为。","建议结合代理 IP 轮换与 Sticky Session 策略，遇到 403\u002F429 错误时进行指数退避并切换 IP。",false,"2026-05-06T14:35:22+00:00","2026-10-03T23:53:00+00:00",11,{"name":45,"slug":46,"bio":47,"avatar_url":14,"website_url":14,"social_links":14},"ProxyHat Team","proxyhat-team","The ProxyHat editorial team covers proxies, web scraping, and data extraction.",[49],{"id":50,"slug":51,"name":52,"description":14,"meta_title":53,"meta_description":54,"parent_id":14},5,"dianshang","电商与竞争情报","电商数据抓取指南 | ProxyHat 博客","电商数据抓取、价格监控和竞争情报指南。",[],{"ko":57,"pt":58,"tr":59,"de":60,"en":61,"ru":62,"fr":63,"ja":64,"es":65,"pl":66,"it":67,"zh":13,"x-default":61},"\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","\u002Fja\u002Fblog\u002Fwalmart-scraping-guide-proxy","\u002Fes\u002Fblog\u002Fguia-scraping-walmart-datos-producto","\u002Fpl\u002Fblog\u002Fjak-scrapowac-walmart-2025","\u002Fit\u002Fblog\u002Fscraping-walmart-dati-prodotto",{"ko":57,"pt":58,"tr":59,"de":60,"en":61,"ru":62,"fr":63,"ja":64,"es":65,"pl":66,"it":67,"zh":13},69,[71,105,122,138],{"id":72,"slug":73,"title":74,"excerpt":75,"featured_image_url":76,"featured_image_alt":77,"card_image_url":78,"og_image_url":79,"published_at":80,"updated_at":81,"content_updated_at":82,"reading_time_minutes":83,"is_featured":40,"indexable":4,"views":84,"author":85,"categories":86,"tags":88},215,"tiktok-shop-shangpin-shuju-caiji","采集 TikTok Shop 商品数据用于市场调研","官方渠道优先：TikTok Shop Partner API 和 Research API 实际开放了哪些数据，什么时候授权数据更划算，以及如何在正确的市场里慢速读取公开商品页。","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fzh\u002Ftiktok-shop-shangpin-shuju-caiji-master.webp","Collecting TikTok Shop Product Data for Market Research","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fzh\u002Ftiktok-shop-shangpin-shuju-caiji-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fzh\u002Ftiktok-shop-shangpin-shuju-caiji-og.webp","2026-10-29T09:00:00+00:00","2026-10-29T09:00:19+00:00","2026-10-03T09:41:40+00:00",16,44,{"name":45,"slug":46,"bio":47,"avatar_url":14,"website_url":14,"social_links":14},[87],{"id":50,"slug":51,"name":52,"description":14,"meta_title":53,"meta_description":54,"parent_id":14},[89,93,97,101],{"id":90,"slug":91,"name":92},1,"web-scraping","网页抓取",{"id":94,"slug":95,"name":96},14,"ecommerce","电商",{"id":98,"slug":99,"name":100},15,"price-monitoring","价格监控",{"id":102,"slug":103,"name":104},18,"geo-targeting","地理定位",{"id":106,"slug":107,"title":108,"excerpt":109,"featured_image_url":110,"featured_image_alt":111,"card_image_url":112,"og_image_url":113,"published_at":114,"updated_at":114,"content_updated_at":115,"reading_time_minutes":116,"is_featured":40,"indexable":40,"views":117,"author":118,"categories":119,"tags":121},179,"temu-shangpin-jiage-zhuqu-zhinan-2026","如何在2026年抓取Temu商品与价格数据：代理、反爬与隐藏JSON端点全指南","Temu没有公开API，抓取商品与价格数据需在易变的HTML卡片和内部JSON端点之间做出选择。本指南涵盖反爬技术栈、curl_cffi实战代码、住宅代理城市级定位及合规要点。","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fzh\u002Ftemu-shangpin-jiage-zhuqu-zhinan-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\u002Fzh\u002Ftemu-shangpin-jiage-zhuqu-zhinan-2026-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fzh\u002Ftemu-shangpin-jiage-zhuqu-zhinan-2026-og.webp","2026-07-21T10:05:01+00:00","2026-11-17T09:21:33+00:00",12,220,{"name":45,"slug":46,"bio":47,"avatar_url":14,"website_url":14,"social_links":14},[120],{"id":50,"slug":51,"name":52,"description":14,"meta_title":53,"meta_description":54,"parent_id":14},[],{"id":123,"slug":124,"title":125,"excerpt":126,"featured_image_url":127,"featured_image_alt":128,"card_image_url":129,"og_image_url":130,"published_at":131,"updated_at":131,"content_updated_at":132,"reading_time_minutes":116,"is_featured":40,"indexable":40,"views":133,"author":134,"categories":135,"tags":137},181,"ruhe-zhuazhu-gouwu-jiege-2026","如何在2026年抓取Google Shopping价格与商品数据","Google Shopping的Content API只服务商家自有商品，要做竞品价格情报必须解析tbm=shop的SERP HTML。本文用ProxyHat住宅代理给出可运行的Python方案，覆盖反爬栈、选择器、城市级地理定位与合规边界。","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fzh\u002Fruhe-zhuazhu-gouwu-jiege-2026-master.webp","How to Scrape Google Shopping Prices in 2026: A Practical Guide","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fzh\u002Fruhe-zhuazhu-gouwu-jiege-2026-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fzh\u002Fruhe-zhuazhu-gouwu-jiege-2026-og.webp","2026-07-18T16:05:15+00:00","2026-10-03T08:29:55+00:00",141,{"name":45,"slug":46,"bio":47,"avatar_url":14,"website_url":14,"social_links":14},[136],{"id":50,"slug":51,"name":52,"description":14,"meta_title":53,"meta_description":54,"parent_id":14},[],{"id":139,"slug":140,"title":141,"excerpt":142,"featured_image_url":143,"featured_image_alt":144,"card_image_url":145,"og_image_url":146,"published_at":147,"updated_at":147,"content_updated_at":148,"reading_time_minutes":43,"is_featured":40,"indexable":40,"views":149,"author":150,"categories":151,"tags":153},145,"guimo-zhuaqu-shein-2026","2026年大规模抓取Shein数据：商品、价格与库存爬取实战指南","Shein的Akamai反爬让普通爬虫寸步难行。本文从内部API与渲染HTML的取舍出发，详解_abck\u002Fsensor_data机制、住宅代理地理定位、curl_cffi实战代码与412重试逻辑，助你在2026年稳定获取公开商品与价格数据。","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fzh\u002Fguimo-zhuaqu-shein-2026-master.webp","Scraping Shein at Scale in 2026: A Practical Proxy Guide for Price Intelligence","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fzh\u002Fguimo-zhuaqu-shein-2026-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fzh\u002Fguimo-zhuaqu-shein-2026-og.webp","2026-07-17T10:04:35+00:00","2026-10-03T08:21:25+00:00",336,{"name":45,"slug":46,"bio":47,"avatar_url":14,"website_url":14,"social_links":14},[152],{"id":50,"slug":51,"name":52,"description":14,"meta_title":53,"meta_description":54,"parent_id":14},[],[]]