From 691f96e8a6262a3dceead024c2b7a60eb45729a5 Mon Sep 17 00:00:00 2001 From: Chen Gu Date: Thu, 26 Mar 2026 19:15:53 +0800 Subject: [PATCH] Document Lightpanda learnings and proxy notes --- .learnings/ERRORS.md | 35 +++++++++++++++++++++++++++++++++++ .learnings/LEARNINGS.md | 27 +++++++++++++++++++++++++++ TOOLS.md | 15 +++++++++++++++ 3 files changed, 77 insertions(+) diff --git a/.learnings/ERRORS.md b/.learnings/ERRORS.md index 1e8d1cc..1edb615 100644 --- a/.learnings/ERRORS.md +++ b/.learnings/ERRORS.md @@ -32,3 +32,38 @@ fetch failed --- +## [ERR-20260326-002] lightpanda + +**Logged**: 2026-03-26T08:35:04Z +**Priority**: high +**Status**: pending +**Area**: config + +### Summary +Lightpanda 当前实例在访问多类站点时存在 SslConnectError、GotNothing 与连接被重置等稳定性问题 + +### Error +``` +Observed failures while driving Lightpanda via CDP on ws://127.0.0.1:9222/: +- Navigation failedReason: SslConnectError +- Navigation failedReason: GotNothing +- ConnectionResetError: [Errno 54] Connection reset by peer +- IncompleteReadError after session dropped during/after navigation +``` + +### Context +- Operation attempted: 使用自写 CDP 探针连接本地 Lightpanda,访问 example.com、Google、Bing、DuckDuckGo、Wikipedia、lightpanda.io、Hacker News、GitHub、Baidu、Zhihu、Bilibili、docs.python.org、httpbin 等站点 +- Successful sample: example.com、cn.bing.com/search?q=lightpanda +- Proxy finding: 本机 127.0.0.1:7890 不通;127.0.0.1:7897 可连接 +- Impact: 目前 Lightpanda 仅适合作为受限场景下的实验性浏览器后端,不能默认承担通用网页访问任务 + +### Suggested Fix +检查 Lightpanda 启动参数、代理设置、TLS/证书处理与日志输出;优先确认浏览器实例是否显式走 127.0.0.1:7897,并改为串行站点测试后再逐步扩大兼容范围。 + +### Metadata +- Reproducible: yes +- Related Files: tmp/lightpanda_probe.py, tmp/lightpanda_nav.py, tmp/lightpanda_search.py, tmp/lightpanda_search_debug.py, tmp/lightpanda_probe_site.py +- See Also: ERR-20260326-001 + +--- + diff --git a/.learnings/LEARNINGS.md b/.learnings/LEARNINGS.md index a4e9570..40fbe8f 100644 --- a/.learnings/LEARNINGS.md +++ b/.learnings/LEARNINGS.md @@ -29,3 +29,30 @@ --- +## [LRN-20260326-002] best_practice + +**Logged**: 2026-03-26T08:35:04Z +**Priority**: high +**Status**: pending +**Area**: config + +### Summary +使用 Lightpanda 做网页自动化时,应优先把它视为“待验证的特定站点浏览器”,而不是默认当作通用浏览器 + +### Details +在连接本地 9222 端口的 Lightpanda 实例后,已验证其支持基本 CDP 流程:可连接 websocket、创建 target、attach session、打开 example.com,并读取 document.title 与 document.body.innerText。同时也验证到站点兼容性非常不均匀:cn.bing.com 搜索页可正常加载并提取结果;但 Google 搜索会话会中途断开,DuckDuckGo、Wikipedia、lightpanda.io、Hacker News 等站点出现 SslConnectError,GitHub 及多站点并发探测时还出现 Connection reset by peer。由此可知,当前实例更适合单站点、串行、小范围验证,不适合直接假设为稳定的通用浏览器后端。 + +### Suggested Action +后续使用 Lightpanda 时,先用一小组目标站点做串行兼容性验证并记录结果;默认优先使用已验证可用的站点(如 Bing),避免一开始并发探测或直接依赖复杂站点。 + +### Metadata +- Source: conversation +- Related Files: tmp/lightpanda_probe.py, tmp/lightpanda_nav.py, tmp/lightpanda_probe_site.py +- Tags: lightpanda, cdp, browser-automation, compatibility, best-practice +- Pattern-Key: lightpanda.validate_target_sites_before_generalizing +- Recurrence-Count: 1 +- First-Seen: 2026-03-26 +- Last-Seen: 2026-03-26 + +--- + diff --git a/TOOLS.md b/TOOLS.md index 917e2fa..c58cba4 100644 --- a/TOOLS.md +++ b/TOOLS.md @@ -38,3 +38,18 @@ Skills are shared. Your setup is yours. Keeping them apart means you can update --- Add whatever helps you do your job. This is your cheat sheet. + +## Network / Proxy + +- Current local HTTP proxy: `127.0.0.1:7897` +- `127.0.0.1:7890` was checked on 2026-03-26 and was not accepting connections + +## Lightpanda + +- Local Lightpanda CDP endpoint observed at: `ws://127.0.0.1:9222/` +- Current behavior snapshot (2026-03-26): + - Basic CDP control works (connect / create target / navigate / evaluate JS) + - `example.com` and Bing search were reachable in testing + - Many other sites failed with `SslConnectError`, `GotNothing`, or session resets +- Treat the current Lightpanda instance as **experimental and site-specific**, not a general-purpose browser by default +- Prefer **serial, one-site-at-a-time validation** before depending on it for new browsing tasks