cannot connect to chrome at 127.0.0.1:9222

Posted uni-hoang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了cannot connect to chrome at 127.0.0.1:9222相关的知识,希望对你有一定的参考价值。

  • window10系统,先cmd打开chrome,
    chrome --remote-debugging-port=9222
  • 执行脚本
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By


def test_adduser():
    options=Options()
    options.add_experimental_option(‘debuggerAddress‘, ‘127.0.0.1:9222‘)
    driver=webdriver.Chrome(options=options)
    driver.implicitly_wait(5)
    driver.find_element(By.CSS_SELECTOR,‘.js_service_list a:nth-child(1) .index_service_cnt_item_title‘).click()
  • 报错
>       raise exception_class(message, screen, stacktrace)
E       selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:9222
E       from chrome not reachable

..venvlibsite-packagesseleniumwebdriver
emoteerrorhandler.py:242: WebDriverException

重启电脑,问题解决


以上是关于cannot connect to chrome at 127.0.0.1:9222的主要内容,如果未能解决你的问题,请参考以下文章

cannot connect to daemon at tcp:5037: cannot connect to 127.0.0.1:5037: 由于目标计算机积极拒绝,无法连接。 (10061)(示例

cannot connect to IP: 由于目标计算机积极拒绝,无法连接。 (10061)

centos 环境正确配置 wkhtmltopdf:cannot connect to X server

error: cannot connect to daemon解决办法

unable to connect to 127.0.0.1:62001: cannot connect to 127.0.0.1:62001: 由于目标计算机积极拒绝,无法连接。 (10061)

adb 运行提示error: cannot connect to daemon