用途:当任务涉及日本邮政 Web Yu-pri 标签录入(https://mgr.post.japanpost.jp/C30P01Action.do),尤其是重复填写内容行时,可使用该 CLI。它通过驱动真实浏览器 UI 完成登录、页面检查、截图、dry-run 规划和内容表单填写。
安装: pip install git+https://github.com/HKUDS/CLI-Anything.git#subdirectory=web-yu-pri/agent-harness 若未找到浏览器: python -m playwright install chromium
安全规则:不要把日本邮政凭据写入命令、文件、日志或提示中;使用 open-login 让用户在弹出的持久化配置中手动登录;在真实填写前先运行 contents fill ... --dry-run --json;该 CLI 不会点击最终发货确认或购买按钮;当源数据带有独立奖项/类别行时,保持条目行分开,同时保留所声明的总价值。
常用命令: cli-anything-web-yu-pri --json doctor cli-anything-web-yu-pri open-login cli-anything-web-yu-pri --json status --url https://mgr.post.japanpost.jp/M060800.do cli-anything-web-yu-pri --json plan items.json cli-anything-web-yu-pri --json contents fill items.json --dry-run cli-anything-web-yu-pri --json contents fill items.json --total-value 17000
条目文件支持 JSON(items 数组,含 description、value、quantity、country 等字段)和 CSV。CSV 表头别名:description 可用 description/desc/content/contents/item/name/pkg;value 可用 value/declared_value/cost/price/amount/yen/jpy;quantity 可用 quantity/qty/num/count;country 可用 country/country_code/country_of_origin/origin/couCd/cou_cd;HS code 可用 hs_code/hs/hscode/hsCode。默认 value 视为行申报价值,使用 --value-mode unit 时 value 会乘以数量。
选择器诊断: cli-anything-web-yu-pri --json selectors cli-anything-web-yu-pri snapshot --url https://mgr.post.japanpost.jp/M060800.do -o page.png --html-output page.html
已知内容页控件包括:#M060800_itemBean_pkg、#M060800_itemBean_cost_value、#M060800_itemBean_num_value、#M060800_itemBean_couCd、#M060800_itemBean_hsCode、#M060800_shippingBean_pkgType、#M060800_shippingBean_pkgTotalPrice_value、#M060800_ShippingBean_danger,以及 submitCommand('itemAdd2')。
适用场景为日本邮政标签内容行的批量或重复录入。限制:不执行最终确认或购买操作;需要手动登录;具体页面行为和可用性依赖实际网站环境,资料未提供更多细节。