【问题标题】:Message: unknown error: cannot connect to chrome at 127.0.0.1:59113消息:未知错误:无法在 127.0.0.1:59113 连接到 chrome
【发布时间】:2022-09-23 02:11:10
【问题描述】:

当我想将用户添加到 Selenium 选项时出现此错误

代码:

import undetected_chromedriver as UC
from selenium.webdriver.chrome.options import Options

chrome_options = Options()
chrome_options.add_argument(f\"--user-data-dir=/home/ali/.config/google-chrome/Default\")

错误:

File \"/home/ali/programming/something/main.py\", line 41, in <module>
    driver = UC.Chrome(executable_path=driverLocation, options=chrome_options)
  File \"/home/ali/.local/lib/python3.10/site-packages/undetected_chromedriver/__init__.py\", line 401, in __init__
    super(Chrome, self).__init__(
  File \"/home/ali/.local/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py\", line 69, in __init__
    super().__init__(DesiredCapabilities.CHROME[\'browserName\'], \"goog\",
  File \"/home/ali/.local/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py\", line 92, in __init__
    super().__init__(
  File \"/home/ali/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py\", line 277, in __init__
    self.start_session(capabilities, browser_profile)
  File \"/home/ali/.local/lib/python3.10/site-packages/undetected_chromedriver/__init__.py\", line 589, in start_session
    super(selenium.webdriver.chrome.webdriver.WebDriver, self).start_session(
  File \"/home/ali/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py\", line 370, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File \"/home/ali/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py\", line 435, in execute
    self.error_handler.check_response(response)
  File \"/home/ali/.local/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py\", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:44063
from chrome not reachable

系统:

铬 103.0.5060.134
Ubuntu 22.04

当我不添加用户时它可以正常工作
我该如何解决??(当我想添加用户时)

谢谢

  • 更新你的铬

标签: python-3.x selenium undetected-chromedriver


【解决方案1】:

同样的问题。你修好了吗?

【讨论】:

猜你喜欢
  • 2022-10-20
  • 2018-02-07
  • 1970-01-01
  • 2020-06-06
  • 1970-01-01
  • 1970-01-01
  • 2018-10-23
  • 2020-02-12
  • 2022-01-16
相关资源
最近更新 更多