Skip to content

fix(連接器): 以 CDP 擷取第一銀行 010103 明細 - #112

Merged
TedLin1993 merged 1 commit into
mainfrom
codex/firstbank-cdp-010103
Aug 29, 2026
Merged

fix(連接器): 以 CDP 擷取第一銀行 010103 明細#112
TedLin1993 merged 1 commit into
mainfrom
codex/firstbank-cdp-010103

Conversation

@TedLin1993

Copy link
Copy Markdown
Owner

問題

PR #111 在本機可成功擷取第一銀行交易明細,但 production Browser Rendering 仍回傳 502。原因是 010103 導覽會替換/分離結果 iframe,而 page response 事件沒有收到該 iframe 的 document HTTP 回應。

修正

  • 保留銀行頁面原生 #searchBtn 點擊流程,不重播表單 POST。
  • 查詢前透過 page-level CDP session 啟用 Network,為 response body 設定有限的 1 MiB buffer。
  • 只追蹤第一銀行同源、精確 /NetBank/2/010103.html 且資源類型為 Document 的回應。
  • 等待 Network.loadingFinished 後,以 request ID 呼叫 Network.getResponseBody,並支援一般文字與 base64 body。
  • 保留既有 live frame 與 page response 路徑;沒有合法 frame 或 document body 時維持短期限快速失敗。
  • 完整移除 CDP listeners 並 detach session;不記錄 URL、HTML、帳戶或任何敏感資料。

測試

  • npm run format:check
  • npm run typecheck
  • npm run test:backend
  • First Bank session tests:13 passed
  • Worker tests:406 passed
  • DB tests:4 passed
  • deploy/sync script tests:16 passed

本次未執行 production 或任何包含銀行登入資料的同步;驗證範圍為程式碼、合成測試與專案檢查。

@cloudflare-workers-and-pages

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
taiwan-fin-hub 7d78ff0 Aug 29 2026, 04:01 AM

@TedLin1993
TedLin1993 marked this pull request as ready for review August 29, 2026 04:20
@TedLin1993
TedLin1993 merged commit d27b545 into main Aug 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant