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')