apple-cn-checkout
DiscoveredFully Automated iPhone Flash Sale Script
全自动抢购 iPhone 脚本
skill 名:
apple-cn-checkout—— 用浏览器自动化在苹果中国官网apple.com.cn完成 iPhone 选购与结账, 附实测稳定选择器、静默失败陷阱清单、CDP 计时的耗时预算、以及多入口降级梯子。
English TL;DR — An agent skill for buying iPhones on Apple's China store (apple.com.cn)
through browser automation. It ships measured-stable selectors, a list of failures that happen
silently (no error, no navigation), a CDP-measured latency budget for every step, and a
3-path entry ladder with retry-before-degrade. All numbers here are measured, not estimated.
为什么需要它
Apple 中国官网的结账页有一批不会报错的失败。你点了按钮、工具返回"已点击", 但什么都没发生 —— 这比报错更危险:
| 陷阱 | 现象 | 正确做法 |
|---|---|---|
| 点击后立刻读取是旧 DOM | 徽标/URL 都滞后,会误判成功 | 唯一可信验证 = 重新导航到目标页再读(服务端真相) |
waitUntil: networkidle 永不满足 | 页面有持续遥测,等到超时 | 永不使用;改用具体元素门控 |
| 用 CSS 猜选择器会打偏 | 猜的 button[data-autom*="remove"] 命中了别的元素 | 只用以 data-autom 为准的实测选择器 |
隐藏的 radio 用 visible 等不到 | 白白等 10 秒超时 | 用 state:"attached" + :not([disabled])(实测 7ms) |
| 限购静默拦截「结账」 | 袋内同一 iPhone > 2 部时,点「结账」完全无反应(按钮也不是 disabled) | 结账前预检页面是否含「最多可购买」 |
| 按钮在转圈时点击会点空 | 到达新步骤立刻点 → 点空 → 后续连锁超时 | 每步用 :not([disabled]) 等启用再点 |
内容
SKILL.md ← 技能本体(12 节,可直接给 agent 读)
scripts/
battle.sh ← 抢购总脚本:多入口降级 + 每步门控 + 实时换路
monitor.sh ← 开闸监控(两级探测,判定"可提交"后退出 0)
buy.sh ← 开闸后的极速链(配置→提交→进入结账)
preflight.sh ← 开抢前的就绪自检
smoke-test.sh ← 探测逻辑自测
abnormal5.sh ← 故障注入 × 5(验证降级梯子)
bench5.sh / bench-warm.sh ← 入口路径基准(冷/热)
cleanup.sh ← 收尾(撤规则/还原页面)
rules.json / rule-*.json ← `debug` 网络规则样本
apple-bookmarks.html ← 书签(可导入 Edge/Chrome)
docs/
measurements.md ← 全部原始实测数据(CDP 指标、端点耗时、路径基准、故障演练)
battle-plan.md ← 抢购作战计划
安装
作为 DSH 技能:
git clone git@github.com:Caoran1314/apple-cn-checkout.git
cp -r apple-cn-checkout "$HOME/.dsh/skills/apple-cn-checkout"
或只要技能本体:把 SKILL.md 放进 ~/.dsh/skills/apple-cn-checkout/SKILL.md。
依赖
- BrowserSkill:
bskCLI + 浏览器扩展(提供bsk_*工具与bsk命令) - 目标站点:
https://www.apple.com.cn/(中国站,不是apple.com)
实测数据摘要
三条购买入口(n=5,口径:出发 → 「提交按钮已启用」)
| 路 | 入口 | 最快 | 中位 | 最慢 | 均值 | 排名 |
|---|---|---|---|---|---|---|
| A | 深链 SKU /shop/buy-iphone/<机型>/<sku> | 976ms | 1025ms | 1433ms | 1102ms | 🥇 |
| C热 | /shop/bag 已预热 → 点收藏「继续」 | 1250ms | 1284ms | 1694ms | 1361ms | 🥈 |
| B | 通用购买页(需手配 3 项) | 1446ms | 1488ms | 2916ms | 1764ms | 🥉 |
| C冷 | 现加载 /shop/bag → 收藏 → 继续 | 2599ms | 3289ms | 3651ms | 3131ms | ❌ |
关键结论:收藏 → 继续 的落点就是路 A 的深链 URL → A 与 C 一荣俱荣、一损俱损,
B 是唯一能兜底的路。而预热购物车页能把 C 从 3289ms 降到 1284ms(≈A)。
结账各步实测耗时(设超时按这个)
| 步骤 | 实测 |
|---|---|
| 添加到购物袋 | ~1.3–2.1s |
| 结账 → 订单选项 | 4.0–10.8s |
| 继续填写送货地址 | 0.9–2.3s |
| 继续选择付款方式 | 8.5–9.4s |
| 选微信支付 | ~0.05s |
| 检查订单 → 查看订单 | 19.4–19.7s |
| 立即下单 → 二维码 | 7.3–34.4s |
「转圈」的真相(CDP 实测)
主线程 long task 全程只有 0–2 个、合计 51–126ms,而文档 DCL 可达 7.5s —— Apple 结账是「网络受限」,不是「渲染受限」。慢的是服务端:
| 端点 | 次数 | 平均 |
|---|---|---|
/shop/fulfillment-messages | 10 | 815ms(结账那 8s 的主因) |
secure6/shop/checkoutx/fulfillment | 1 | 4161ms |
secure6/shop/bag/status | 1 | 3205ms |
/shop/favoritesx/fetch | 2 | 803ms(收藏异步加载的源头) |
/shop/updateSEO · product-gallery · applecare/data | 3–6 | 37–48ms(配置点击"秒生效"的原因) |
降级梯子(故障注入 × 5,全部一致)
阻断深链文档后:路A 试 3 次(退避 2s→4s)→ 路C 试 2 次 → 路B 试 1 次成功,
每轮 80–83 秒,5/5 零抖动。证明"同路重试优先于换路"这条策略成立。
安全边界
- 不代填任何凭据:登录 / OTP / 支付确认走人工(
request-help) - 不自动点「立即下单」:
battle.sh默认停在「查看订单」页(PLACE_ORDER=0) - 全部数据来自公开站点页面的实测,不含任何个人账号信息
License
MIT
Comments
Loading…
Similar plugins
by Hjay1101
DeepSeek Harness 插件:手机扫码遥控电脑上的 agent —— 在 dsh-remote-link 基础上增强会话持久化(dsh 重启后已配对设备保持登录)、iOS 主屏图标等
★ 0
MIT
JavaScript
Aug 23, 2026
dsh plugin --profile web add dsh-ios-controlby qkycir-123
Automatically turn successful DeepSeek Harness sessions into reusable, reviewable Agent Skills.
★ 110
↓ 544/wk
MIT
TypeScript
Oct 1, 2026
dsh plugin --profile web add dsh-run2skillby cindyguyuehu123
Use DeepSeek Harness from your iPhone / iPad: LAN reverse proxy, iOS PWA (add-to-home-screen) chrome, and touch/mobile CSS for the web GUI
★ 6
↓ 4.2k/wk
MIT
TypeScript
Aug 15, 2026
dsh plugin --profile web add dsh-mobileby AnonyJcy
Mobile & iPad touch optimization plugin for DeepSeek Harness Web GUI
★ 0
MIT
TypeScript
Aug 28, 2026
dsh plugin --profile web add @anonyjcy/dsh-plugin-mobile-touchby radres
Your DeepSeek Harness agent rings your actual phone: it asks out loud, you answer out loud, and what you said steers the run.
★ 8
MIT
JavaScript
Oct 3, 2026
dsh plugin --profile web add dsh-plugin-call-meby yuanzhenqi
Phone-first drawer shell for DSH Web. Collapses the session list into a tap-to-open drawer, keeps header plugin actions, and turns Settings into a full-width sheet.
★ 1
↓ 800/wk
MIT
JavaScript
Sep 1, 2026
dsh plugin --profile web add dsh-mobile-ui