Arang.dev
Search

Fixing Selenium v4.10+ TypeError and webdriver-manager Errors

How to resolve the TypeError and "webdriver-manager LATEST_RELEASE not found" error occurring in the latest version of Selenium.

#selenium#python#webdriver#troubleshooting
🌐 Translated

This post was machine-translated from Korean by AI. Some expressions may differ from the original.

Read the original (Korean)

I was trying to create a Selenium bot, but after simply running pip3 install selenium and applying my existing code, I encountered all sorts of errors.

image

  1. An error occurred because webdriver-manager could not find the latest Chrome driver.

> pip3Ā installĀ git+https://github.com/SergeyPirogov/webdriver_manager

# Solved by installing the latest webdriver_manager


image

  1. The latest version of webdriver-manager requires Python 3.7 or higher.

# Install Python 3.7 or higher


image

  1. The highlighted part is the error, stating TypeError: init() got multiple values for argument 'options'.

Actually, the error isn't caused by options. Apparently, starting from Selenium 4.10 (I think?), the method for specifying the webdriver path has changed and now requires using Service.

fromĀ selenium.webdriver.chrome.serviceĀ importĀ Service
...
self.driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)

# Use ChromeDriverManager().install() via Selenium Service

  1. Additionally, desired_capabilities has been deprecated. I found it annoying, so I just removed the desired_capabilities feature I was previously using.

If anyone knows how to migrate this to options or use it via another method, I would appreciate a comment.

Comments

Loading comments...
Fixing Selenium v4.10+ TypeError and webdriver-manager Errors | Arang