Web Yu-pri CLI 是做什么的?
当任务涉及日本邮政Web Yu-pri标签录入(位于https://mgr.post.japanpost.jp/C30P01Action.do),尤其是重复性的物品明细行录入时,使用本技能。
安装
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": 8000, "quantity": 1, "country": "KR"},
{"description": "证书", "value": 9000, "quantity": 1, "country": "KR"}
]
}
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 时,价值将乘以数量。
选择器诊断
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_dangersubmitCommand('itemAdd2')