Skip to content
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

Chrome Driver can not be installed with LATEST_RELEASE_115.0.5790 tag #536

Closed
david-engelmann opened this issue Jul 18, 2023 · 40 comments
Closed

Comments

@david-engelmann
Copy link

https://chromedriver.storage.googleapis.com website doesn't have a tag LATEST_RELEASE_115.0.5790

    self.driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
  File "/usr/local/lib/python3.8/site-packages/webdriver_manager/chrome.py", line 39, in install
    driver_path = self._get_driver_path(self.driver)
  File "/usr/local/lib/python3.8/site-packages/webdriver_manager/core/manager.py", line 30, in _get_driver_path
    file = self._download_manager.download_file(driver.get_driver_download_url())
  File "/usr/local/lib/python3.8/site-packages/webdriver_manager/drivers/chrome.py", line 40, in get_driver_download_url
    driver_version_to_download = self.get_driver_version_to_download()
  File "/usr/local/lib/python3.8/site-packages/webdriver_manager/core/driver.py", line 51, in get_driver_version_to_download
    self._driver_to_download_version = self._version if self._version not in (None, "latest") else self.get_latest_release_version()
  File "/usr/local/lib/python3.8/site-packages/webdriver_manager/drivers/chrome.py", line 62, in get_latest_release_version
    resp = self._http_client.get(url=latest_release_url)
  File "/usr/local/lib/python3.8/site-packages/webdriver_manager/core/http.py", line 37, in get
    self.validate_response(resp)
  File "/usr/local/lib/python3.8/site-packages/webdriver_manager/core/http.py", line 16, in validate_response
    raise ValueError(f"There is no such driver by url {resp.url}")
ValueError: There is no such driver by url https://chromedriver.storage.googleapis.com/LATEST_RELEASE_115.0.5790

The most recent tags I see are the following

<Contents>
<Key>LATEST_RELEASE_114</Key>
<Generation>1685523456288632</Generation>
<MetaGeneration>1</MetaGeneration>
<LastModified>2023-05-31T08:57:36.412Z</LastModified>
<ETag>"368684b889419678b04e4899d53d7ab0"</ETag>
<Size>13</Size>
</Contents>
<Contents>
<Key>LATEST_RELEASE_114.0.5735</Key>
<Generation>1685523454232974</Generation>
<MetaGeneration>1</MetaGeneration>
<LastModified>2023-05-31T08:57:34.364Z</LastModified>
<ETag>"368684b889419678b04e4899d53d7ab0"</ETag>
<Size>13</Size>
</Contents>
@AbhishekKumarVerma
Copy link

AbhishekKumarVerma commented Jul 18, 2023

this is due to change of hosting path. the latest version is hosted at: https://googlechromelabs.github.io/chrome-for-testing/#stable

@atlas-wong
Copy link

atlas-wong commented Jul 19, 2023

should update to use
https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json
to obtain the latest stable version of chrome driver

improper quick fix:

changed webdriver_manager/webdriver_manager/drivers/chrome.py line 48
from return f"{self._url}/{driver_version_to_download}/{self.get_name()}_{os_type}.zip"
to return f"{self._url}"

and initiate with specified url, e.g.:
driver = webdriver.Chrome(service=Service(ChromeDriverManager(url="https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.98/win64/chromedriver-win64.zip").install()))

@RaccoonWang
Copy link

someone pls submit a PR to fix this

@Brutus03
Copy link

I had the same issue and reached this issue.

Once you download the driver from the new URL as a provisional response and specify the path, it will work.

example

options = webdriver.chrome.options.Options()
new_driver = '/<Your dir pass>/Google\ Chrome\ for\ Testing.app/'
service = ChromeService(executable_path=new_driver)
browser = webdriver.Chrome(service=service, options=options)

There was also an announcement on the official download page.

@kris-dev-cloudwarelab
Copy link

Facing the same issue, any chance we can get an experimental branch of webdriver_manager that at least partially fixes this?

@yacov-ma
Copy link

Hey guys,
You can pass a version to ChromeDriverManager as a workaround.
For example :
s = Service(ChromeDriverManager(version="114.0.5735.90").install())
and it's work.

@LightBit
Copy link

LightBit commented Jul 19, 2023

This is the quick & dirty code to get URL for specific version:

def get_url_for_version_and_platform(version, platform):
    url = "https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json"
    response = requests.get(url)
    data = response.json()
    versions = data["versions"]

    for v in versions:
        if v["version"] == version:
            downloads = v["downloads"]["chromedriver"]
            for d in downloads:
                if d["platform"] == platform:
                    return d["url"]

    return None


print(get_url_for_version_and_platform("115.0.5790.98", "win32"))

This can be used in webdriver_manager/webdriver_manager/drivers/chrome.py, if version is 115.0.5790.98 or higher.

@david-engelmann
Copy link
Author

Here is a PR - #537 to patch the issue with version 155.0.5790.98 and higher

@jgehrcke
Copy link

A workaround (I am OK storing right into / in my container image; you can adjust paths as desired obviously):

curl -fsSL -o /chromedriver.zip https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.98/linux64/chromedriver-linux64.zip
unzip /chromedriver.zip

And then

...
    driver = webdriver.Chrome(
        service=Service(executable_path="/chromedriver-linux64/chromedriver"),
        options=wd_options,
    )
...

these imports:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service

@david-engelmann
Copy link
Author

working patched version until #537 is merged

@QAthulhu
Copy link

What's the status of this?

@david-engelmann
Copy link
Author

What's the status of this?

pending merge of #537

@lijoabraham
Copy link

+1

2 similar comments
@valsky4
Copy link

valsky4 commented Jul 20, 2023

+1

@alphacentauridigital
Copy link

+1

@abilash-c
Copy link

working patched version until #537 is merged

Thank you David for the fix. Is there an estimated timeline for when this will be merged?

@david-engelmann
Copy link
Author

@abilash-c It's been approved by 3 users, so It should be pretty soon. I know its an in demand fix!

@david-engelmann
Copy link
Author

for the time being, I've updated my testing pipelines with the following additional pip install logic after my main pip install command. I'll delete it once the merge goes through

mkdir tmp_webdriver_folder; cd tmp_webdriver_folder; git clone https://github.com/david-engelmann/webdriver_manager.git; cd webdriver_manager; pip install -e .; cd ../..;

@phcamargo23
Copy link

How can I fix my application without waiting for the pull request to be accepted? 😥
I tried to upgrade the dependency directly via the pull request branch (pip install git+https://github.com/david-engelmann/webdriver_manager.git@de-upgrade-chrome-version), but it didn't work.

@david-engelmann
Copy link
Author

@phcamargo23 What os are you using, we are finishing up MacOs with recent chrome versions now. if its linux, checkout the above comment

@PPinonFire
Copy link

I've updated my files with the pull request that @david-engelmann provided, but I'm running into another issue. Is it not possible to download the driver for a specific chrome version after 115? My chrome is automatically updated by my employer, and currently I'm using 115.0.5790.99 while the latest stable in the API is 115.0.5790.98. Could it just be that the latest stable hasn't been updated in the endpoint?

@david-engelmann
Copy link
Author

david-engelmann commented Jul 20, 2023

I've updated my files with the pull request that @david-engelmann provided, but I'm running into another issue. Is it not possible to download the driver for a specific chrome version after 115? My chrome is automatically updated by my employer, and currently I'm using 115.0.5790.99 while the latest stable in the API is 115.0.5790.98. Could it just be that the latest stable hasn't been updated in the endpoint?

correct what's in the google chrome endpoints is not in our control, you can checkout the chrome-for-testing endpoints for what versions they are supporting

@QAthulhu
Copy link

Google also recommends using chrome for testing rather than the commercial version of chrome. Will webdriver manager only work with the normal chrome?

@david-engelmann
Copy link
Author

@QAthulhu webdriver manager uses the chrome-for-testing endpoints for the recent chrome versions

@SudhanshuBlaze
Copy link

SudhanshuBlaze commented Jul 21, 2023

should update to use https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json to obtain the latest stable version of chrome driver

improper quick fix:

changed webdriver_manager/webdriver_manager/drivers/chrome.py line 48 from return f"{self._url}/{driver_version_to_download}/{self.get_name()}_{os_type}.zip" to return f"{self._url}"

and initiate with specified url, e.g.: driver = webdriver.Chrome(service=Service(ChromeDriverManager(url="https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.98/win64/chromedriver-win64.zip").install()))

On Mac, I had done some more modifications after following your steps:

Below code solved the problem of chrome binary not found
options.binary_location='/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'

and in the below code I had to provide the hard coded path of my chromedriver

`browser = webdriver.Chrome(executable_path='/Users/sudhanshukumar/.wdm/drivers/chromedriver/mac64/115.0.5790.102/chromedriver', options=options)`

@bkokovich
Copy link

Possible temporary solution while we are waiting FIX.
It's working for me and my case I don't know about your personal.

As wrote yacov-ma - set version you need
s = Service(ChromeDriverManager(version="114.0.5735.90").install())

BUT!
Don't forget to downgrade version of chrome too!
You need to have same version of chrome as version of webdriver. This case is 114.0.5735.90.

So, remove version of chrome you have already used.
apt --purge remove google-chrome-stable or smth like that.

Install new chrome version.
wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/114.0.5735.90/linux64/chrome-linux64.zip
unzip chrome-linux64.zip -d /usr/local/bin/
chmod +x /usr/local/bin/chrome-linux64/chrome

Finally, in code add extra option where you set it.

     options = webdriver.ChromeOptions()
    options.binary_location = "/usr/local/bin/chrome-linux64/chrome"
    options.add_argument("--headless")
    

@SergeyPirogov
Copy link
Owner

Fixed in 3.9.0

@abilash-c
Copy link

@david-engelmann @SergeyPirogov
Hi, I installed version 3.9.0 and ran my code. I got this error

File "C:\Users\xxx\Anaconda3\envs\xxx\lib\site-packages\webdriver_manager\drivers\chrome.py", line 89, in get_url_for_version_and_platform
raise Exception(f"No such driver version {browser_version} for {platform}")
Exception: No such driver version 115.0.5790.99 for win32

I solved this error by updating Chrome but why was the older version not mentioned on that website? Do you know if this happens often?

Thanks in advance!

@david-engelmann
Copy link
Author

@abilash-c I'm not sure why some versions are supported and others aren't but the best place to ask is the chrome-for-testing repo. They also have a google group that they are responsive on!

@kai0310
Copy link

kai0310 commented Jul 23, 2023

@david-engelmann @SergeyPirogov (cc/ @abilash-c)
Hmmm, I faced a similar problem.
Apparently, the same error occurs.

This seems to be a broken feature.

raise Exception(f"No such driver version {browser_version} for {platform}")
Exception: No such driver version 114.0.5735.248 for mac-arm64

@SergeyPirogov
Copy link
Owner

I dont know. Ask People from Google

@mathiasbynens
Copy link

Hi, Person from Google here :D We only released ChromeDriver via CfT infrastructure in M115, so older versions are not available via the new endpoints.

@kai0310
Copy link

kai0310 commented Jul 23, 2023

@mathiasbynens

Thank you for your reply!
Yes, I understand what you say and why it is not working.
But I think we are struggling to understand the problem and find a solution.

We are looking for two solutions.
The first is a patchy solution to solve the problem immediately.
The second is a permanent solution that will permanently support the user's intended behavior even after this major update is made in the future.
thanks.

@david-engelmann
Copy link
Author

david-engelmann commented Jul 23, 2023

@david-engelmann @SergeyPirogov (cc/ @abilash-c) Hmmm, I faced a similar problem. Apparently, the same error occurs.

This seems to be a broken feature.

raise Exception(f"No such driver version {browser_version} for {platform}")
Exception: No such driver version 114.0.5735.248 for mac-arm64

I think this is because it's using the new endpoints for version 114. I have on my fork 115 as the min version for the new endpoints. It was mentioned in the original pull request that the criteria for should be 115 or greater but the package author probably didn't follow the whole thread and just saw 113 in the new endpoints

@QAthulhu
Copy link

is this only supposed to work with Chrome for Testing? I've noticed that if only Chrome is installed it doesn't work, getting error Encountered an Error: Message: unknown error: cannot find Chrome binary

But as soon as chrome for testing is installed it works. I don't think it was announced that all users need to migrate to chrome for testing

@LightBit
Copy link

Hi, Person from Google here :D We only released ChromeDriver via CfT infrastructure in M115, so older versions are not available via the new endpoints.

Why there is no 115.0.5790.99 in https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json?

@SergeyPirogov
Copy link
Owner

is this only supposed to work with Chrome for Testing? I've noticed that if only Chrome is installed it doesn't work, getting error Encountered an Error: Message: unknown error: cannot find Chrome binary

But as soon as chrome for testing is installed it works. I don't think it was announced that all users need to migrate to chrome for testing

I github action I have just google-chrome and it works fine. The only issue with MacOS, but I see that they had an assiue GoogleChromeLabs/chrome-for-testing#30

@QAthulhu
Copy link

is this only supposed to work with Chrome for Testing? I've noticed that if only Chrome is installed it doesn't work, getting error Encountered an Error: Message: unknown error: cannot find Chrome binary
But as soon as chrome for testing is installed it works. I don't think it was announced that all users need to migrate to chrome for testing

I github action I have just google-chrome and it works fine. The only issue with MacOS, but I see that they had an assiue GoogleChromeLabs/chrome-for-testing#30

Ah yes I was running it on Mac OS. Thanks, this seems to be an issue with ChromeDriver itself

@TufayelLUS
Copy link

If this problem is still not solved, you can try this code snippet that I wrote which downloads chromedriver from the latest hosted links: https://github.com/TufayelLUS/Python-Selenium-Automated-Chromedriver-Update
I hope this helps. And if anyone has time to integrate this into the library, that would be awesome too. But for now, not relying on this library as it's broken. Even the latest version throws the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests