V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
1500176279
V2EX  ›  Python

selenium 频繁卡死,查找网上很多资料,都不行,求大佬们给个解决方案!

  •  
  •   1500176279 · 2022-09-04 11:48:27 +08:00 · 2142 次点击
    这是一个创建于 601 天前的主题,其中的信息可能已经有所发展或是发生改变。

    日志:

    DEBUG:selenium.webdriver.remote.remote_connection:GET http://127.0.0.1:22996/session/1c5f3672e62d8271f7740a3c81ad0444/source {}

    就一直卡在这,程序无法继续执行后面的代码,我也设置隐形等待 30 秒。

    7 条回复    2022-10-03 12:17:00 +08:00
    masker
        1
    masker  
       2022-09-04 11:54:05 +08:00 via Android
    puppteer
    1500176279
        2
    1500176279  
    OP
       2022-09-04 12:02:56 +08:00
    @masker 谢谢,换那个工程量太大
    lianjin
        3
    lianjin  
       2022-09-04 15:13:38 +08:00
    定时重启
    xinJang
        4
    xinJang  
       2022-09-05 10:39:06 +08:00
    换 Playwright 么有切换成本,性能更高,效率更快
    bantianys
        5
    bantianys  
       2022-09-05 17:08:29 +08:00
    1 、是不是本机的负载过高,导致不能及时处理 get 请求?
    2 、升级下 driver 版本,如果使用的是 chrome 就升级 chromedriver
    1500176279
        6
    1500176279  
    OP
       2022-10-03 08:52:44 +08:00
    @bantianys 这个版本不是对应的吗?比如 chrome 98 chromedriver 就必须用 98 吧,升级不行吧
    bantianys
        7
    bantianys  
       2022-10-03 12:17:00 +08:00
    @1500176279 是的,所以浏览器和 webdriver 都升级下试试。另外看下 22996 端口是否能正常连接,chrome.log 有无异常信息。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1514 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 16:53 · PVG 00:53 · LAX 09:53 · JFK 12:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.