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
xiaozaiziwyt
V2EX  ›  Python

爬虫时用 chromedriver 模拟一直提示 cannot connect to chrome at 127.0.0.1:9222

  •  
  •   xiaozaiziwyt · 2019-03-20 22:09:11 +08:00 · 5206 次点击
    这是一个创建于 1836 天前的主题,其中的信息可能已经有所发展或是发生改变。

    源码 selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:9222

    通过 chrome.exe --remote-debugging-post=9222 能启动,但是进不了 http://127.0.0.1:9222/和 http://127.0.0.1:9222/json ……

    网上找了也没有什么实际解决办法,想问问 v 友们有没有什么办法……

    7 条回复    2021-04-14 12:31:47 +08:00
    yichinzhu
        1
    yichinzhu  
       2019-03-20 22:44:51 +08:00 via Android
    port。。。
    masker
        2
    masker  
       2019-03-21 08:10:03 +08:00 via Android
    。。。动手解决问题的能力越来越差 。。。
    ClutchBear
        3
    ClutchBear  
       2019-03-21 09:34:37 +08:00
    chromedriver 跟 chrome 有版本对应关系的,
    你看看是不是一致.
    allgy
        4
    allgy  
       2019-03-21 11:42:50 +08:00
    手动写爬虫吧,遇到问题好解决
    Deathminip
        5
    Deathminip  
       2019-03-21 12:21:54 +08:00
    不懂 chromedriver,不过我看了一天 puppeteer 的中文文档,写了个爬虫,目前本地和服务器都稳定跑着,自动切换代理 IP 什么的,都没问题
    yxlbeyond
        6
    yxlbeyond  
       2019-03-21 17:58:47 +08:00
    看看 chrome 版本和 chromedriver 版本是否对应
    yuanbo95
        7
    yuanbo95  
       2021-04-14 12:31:47 +08:00
    可能是因为在 chrome 浏览器未关闭的情况下,就执行 chrome.exe --remote-debugging-port=9222 这个命令,要去任务管理器里查看是否有 chrome 进程的留存
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2526 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 15:43 · PVG 23:43 · LAX 08:43 · JFK 11:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.