您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

selenium.common.exceptions.WebDriverException:消息:chrome与ChromeDriver一起使用find_element_by_idSelenium时无法访问错误

selenium.common.exceptions.WebDriverException:消息:chrome与ChromeDriver一起使用find_element_by_idSelenium时无法访问错误

错误说明了一切:

    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: chrome not reachable

用户使用的二进制文件之间存在 情况下,会观察到此错误,但绝对不是您所遇到的情况:

chromedriver = 2.36发行说明中明确提到:

Supports Chrome v65-66

但是,自从发布最新的 Chromedriver 2.36Selenium以来,用户一直在面对它的问题。这是线程之一:

根本原因与以下方面的提交有关:

因此,有两种可能的解决方案:

使用 ChromeOptions 类最大化浏览器。

删除 选项 disable-infobars

        from selenium import webdriver
    from selenium.webdriver.chrome.options import Options

    options = Options()
    options.add_argument("start-maximized")
    driver = webdriver.Chrome(chrome_options=options, executable_path=r'C:\path\to\chromedriver.exe')
    driver.get('https://www.google.co.in')
    print("Page Title is : %s" %driver.title)

如果问题仍然存在,请考虑以下事项:

其他 2022/1/1 18:15:18 有517人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶