简体   繁体   English

Selenium Driver for Edge 获取恒定版本错误

[英]Selenium Driver for Edge getting constant version error

I was trying to figure out why I am getting the same problem everytime using a python script for autocomplete an exercise on https://at4.typewriter.at/ .我试图弄清楚为什么每次使用 python 脚本自动完成https://at4.typewriter.at/上的练习时都会遇到同样的问题。

Every time it says:每次都说:

 DevTools listening on ws://127.0.0.1:50195/devtools/browser/4e38eb0d-6ef9-4d13-9553-820801ba1832
[9492:9508:1205/011008.125:ERROR:edge_auth_errors.cc(387)] EDGE_IDENTITY: Get Default OS Account failed: Error: Primary Error: kImplicitSignInFailure, Secondary Error: kAccountProviderFetchError, Platform error: 0, Error string:

Traceback (most recent call last):
  File "typewriterbot.py", line 167, in <module>
    driver = Login()
  File "typewriterbot.py", line 52, in Login
    driver = webdriver.Edge("driver\msedgedriver.exe")
  File "C:\Program Files\Python37\lib\site-packages\selenium\webdriver\edge\webdriver.py", line 66, in __init__
    desired_capabilities=capabilities)
  File "C:\Program Files\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Program Files\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Program Files\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Program Files\Python37\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of MSEdgeDriver only supports MSEdge version 98
Current browser version is 96.0.1054.43 with binary path C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe

I already updated the driver through Microsoft and checked if the python binaries (if it is called so) were at the high enough version to run the code.我已经通过 Microsoft 更新了驱动程序,并检查了 python 二进制文件(如果被调用)是否处于足够高的版本来运行代码。

Best regards CreaGab最好的问候 CreaGab

A few days ago I encountered a similar issue with Selenium, however I was working with Chrome.几天前,我遇到了与 Selenium 类似的问题,但是我正在使用 Chrome。 I did a little digging around and noticed the library that helped me get around this version error can also be applied to Edge.我做了一点挖掘,发现帮助我解决这个版本错误的库也可以应用于 Edge。 Below is the code:下面是代码:

from selenium import webdriver
from webdriver_manager.microsoft import EdgeChromiumDriverManager

driver = webdriver.Edge(EdgeChromiumDriverManager().install())

In a nutshell, once you assign webdriver.Edge(EdgeChromiumDriverManager().install()) it will update Edge driver to its latest version.简而言之,一旦您分配了webdriver.Edge(EdgeChromiumDriverManager().install()) ,它就会将 Edge 驱动程序更新到其最新版本。

More details for this library can be found here: https://pypi.org/project/webdriver-manager/可以在此处找到此库的更多详细信息: https://pypi.org/project/webdriver-manager/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM