运行程序时 Chrome 无法打开

问题描述 投票:0回答:1

亲爱的们,

你能帮忙解决这个问题吗?我的浏览器在运行期间不再打开。非常感谢。

从昨天开始我收到以下错误:

  File "C:\Users\xxxxxxxx\PycharmProjects\pythonProject\AutoLog.py", line 15, in <module>
    driver = webdriver.Chrome(service=service, options=options)
 raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114
Current browser version is 116.0.5845.179 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
Stacktrace:
Backtrace:
    GetHandleVerifier [0x006DA813+48355]
    (No symbol) [0x0066C4B1]
    (No symbol) [0x00575358]
    (No symbol) [0x005961AC]
    (No symbol) [0x00591EF3]
    (No symbol) [0x00590579]
    (No symbol) [0x005C0C55]
    (No symbol) [0x005C093C]
    (No symbol) [0x005BA536]
    (No symbol) [0x005982DC]
    (No symbol) [0x005993DD]
    GetHandleVerifier [0x0093AABD+2539405]
    GetHandleVerifier [0x0097A78F+2800735]
    GetHandleVerifier [0x0097456C+2775612]
    GetHandleVerifier [0x007651E0+616112]
    (No symbol) [0x00675F8C]
    (No symbol) [0x00672328]
    (No symbol) [0x0067240B]
    (No symbol) [0x00664FF7]
    BaseThreadInitThunk [0x767E00C9+25]
    RtlGetAppContainerNamedObjectPath [0x77157B1E+286]
    RtlGetAppContainerNamedObjectPath [0x77157AEE+238]


Process finished with exit code 1

我的代码一开始看起来像这样:

import time
import pyautogui
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
from pynput.keyboard import Key, Controller
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

service = Service()
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=service, options=options)
python google-chrome selenium-webdriver webdriver
1个回答
0
投票

所以所有代码行看起来都很好,但我认为错误是你有更新版本的 chrome。根据错误,库想要114的chrome版本。您可以通过在网络浏览器上输入 chrome://settings/help 来检查版本。如果超过 114,则尝试在终端中写入 (py -m pip uninstall 你使用的任何库),然后 (py -m pip install 你使用的任何库),不带括号,并使用你使用的库的名称,而不是无论你一一使用过什么库。 (我说的是windows。我不知道Mac)。我们只是通过删除并重新安装来更新库。我希望这有帮助...

© www.soinside.com 2019 - 2024. All rights reserved.