-
-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ChromerDriverManager not returning correct path for the chrome driver #665
Comments
+1 |
Seems like new distribution of chromedriver includes THIRD_PARTY_NOTICES.chromedriver next to chromedriver binary. webdriver_manager.core.driver_cache.DriverCacheManager.__get_binary
It looks for a file that contains 'chromedriver' in its name. Notice how it already has a check to skip LICENSE.chromedriver, which also lives next to binary. So fix would be either adding another check to avoid resolving THIRD_PARTY_NOTICES.chromedriver or an improved way to resolve the binary to make sure this issue does not resurface if another file will be added here in future. |
+1 |
Seeing the same issue here. drivers.json "binary_path" is pointing to THIRD_PARTY_NOTICES.chromedriver instead of chromedriver.exe |
to be on the safe side, wouldn't the following condition be more appropriate: or when files contains the full path: |
Just to update @Hasnain-20's answer, I updated his code a bit in case you ran into the "File not found" problem:
|
The complete fix should be by adding another skip condition to the for loop in webdriver_manager/core/driver_cache.py/__get_binary():
If you dont want to edit webdriver_manager lib:
|
So apparently the owner has paused this project for the war in Ukraine, what's the plan? is there somebody else who has permission to merge a PR and publish to PyPi? |
For people like me that need a guide, we need to update a .py file to add an additional check as there is a new file being added to the chromedriver folder Windows, navigate to the following folder or search for 'driver_cache.py' in the C drive right click the driver_cache.py and open with notepad change the following text, BE CAREFUL to ensure the indentation stays the same.
to
and save the file. the chromedriver should run in your scripts as normal as it did before |
@sunnyplaza The PR has been merged and this fix is in the version available on pypi. You'll need to clear your cache from the last driver. |
Can you please let us know how we can have this fix in a specific version of webdriver ? |
@Jheesbrough oh many thanks. I just saw in the comment of #666 that 4.0.2 is available. I will install it |
If you just use the latest version of chromedriver.exe, there seems to be no need to use webdriver-manager. from selenium.webdriver.chrome.webdriver import WebDriver
from selenium.webdriver.chrome.service import Service as ChromeService
driver = WebDriver(service=ChromeService()) |
Windows Users delete all driver files from .wdm folder and re-run your script |
@pweev Thank you very much for the solution. I needed just a small tweak to make it work on Win since in my case I was still getting the error
|
This issue should be closed @Pelmen323, update your package and clear the driver folder and it will work as intended. |
Removing the arg service from driver = webdriver.Chrome() worked for me too:
|
|
This issue should be closed, update your package and clear the driver folder and it will work as intended. |
Confirming that updating the |
Not working, the error occurred like below:
|
Description
The chrome got updated on 23-07-2024 to the version 127.0.6533.72 and so does the chrome_driver. I prepared the new script and downloaded the Chrome Driver via service ChromeDriverManger from webdriver_manager .chrome. and it isn't returning the correct path of the binary. The path returned is mentioned in Error Log section.
The following files were found the downloaded chrome driver binary folder.
Browser and version: Chrome, version 127.0.6533.72
Operating system and architecture: Linux x64
Selenium version: 4.22.0
WebDriverManager version: 4.0.1
WebDriverManager call:
Error log:
Solution:
I solved the issue by using following piece of code
The text was updated successfully, but these errors were encountered: