简体   繁体   中英

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/ .

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.

Best regards CreaGab

A few days ago I encountered a similar issue with Selenium, however I was working with 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. 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.

More details for this library can be found here: https://pypi.org/project/webdriver-manager/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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