ClericPy / ichrome

Chrome controller for Humans, based on Chrome Devtools Protocol(CDP) and python3.7+.
https://pypi.org/project/ichrome/
MIT License
227 stars 29 forks source link

sync chrome.new_tab() 创建不了新页面,返回都是none #139

Open zenghh opened 11 months ago

zenghh commented 11 months ago

INFO 2023-09-23 13:48:35 [ichrome] test.py(47): ChromeDaemon(127.0.0.1:9222) Traceback (most recent call last): File "d:\source\server\p01\test.py", line 120, in <module> test_example() File "d:\source\server\p01\test.py", line 54, in test_example tab._default_recv_callback.append(lambda tab, data: test_cache.append(data))AttributeError: 'NoneType' object has no attribute '_default_recv_callback' 运行的测试代码 chrome117版本

ClericPy commented 11 months ago

同步版本已经不维护了, 放弃吧... 试试 playwright

zenghh commented 11 months ago

playwright 被检测到,只有你的可以运行,能否同步修改下

ClericPy commented 11 months ago

印象中这个问题是 chrome 新版本改了 HTTP 接口还是什么原因. 节后看下吧, 这段时间比较忙, 这项目也很久没碰了

zenghh commented 11 months ago

https://github.com/ClericPy/ichrome/issues/123 跟这异步的一样

ClericPy commented 11 months ago

OK, 我抽个时间加个判断. 挺服的, 不向后兼容, 遇到老版本还得用 get, 不知道他们团队怎么想的

zenghh commented 11 months ago

谢谢

ClericPy commented 11 months ago

我也得谢谢, 你不说我都忘了这bug了, Github和 pypi 老搞二步认证, 弄得好久不提代码了

ClericPy commented 11 months ago

改了 PUT 方法, 结果 Websocket 握手失败 403 了, 我试试能不能修, 修不了就删掉 sync 用法了, 然后用自动事件循环把异步方法都包成同步的做个适配器算了. 很久不维护, debugger 功能里自动事件循环也不好用了, 测试脚本用的 bing 不稳定也调了半天

zenghh commented 11 months ago

谢谢