SergeyPirogov / webdriver_manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

latest chromium version not found

bandophahita opened this issue · comments

The latest chromium version is 120.0.6066 but get_latest_release_version() cannot find the build version.

  File "/Users/me/.pyenv/versions/myproject/lib/python3.11/site-packages/webdriver_manager/core/driver.py", line 48, in get_driver_version_to_download
    return self.get_latest_release_version()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/me/.pyenv/versions/myproject/lib/python3.11/site-packages/webdriver_manager/drivers/chrome.py", line 61, in get_latest_release_version
    determined_browser_version = response_dict.get("builds").get(determined_browser_version).get("version")
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

It would appear that https://googlechromelabs.github.io/chrome-for-testing/latest-patch-versions-per-build.json (which the function uses to determine versions) does not contain the latest chromium version... yet.

It would seem that we need an alternate way to lookup the latest version of chromium.

Overall the whole thing seems buggy. Experiencing the same thing on latest versions of Edge and Brave as well.

commented

Same here, but different error

  File "/Users/dmytro.soltusyuk/Work/personal/atlant_bot/atlant_bot/parser.py", line 19, in get_driver
    print(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install())
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dmytro.soltusyuk/Work/personal/atlant_bot/.venv/lib/python3.11/site-packages/webdriver_
    driver_path = self._get_driver_binary_path(self.driver)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dmytro.soltusyuk/Work/personal/atlant_bot/.venv/lib/python3.11/site-packages/webdriver_
    file = self._download_manager.download_file(driver.get_driver_download_url(os_type))
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dmytro.soltusyuk/Work/personal/atlant_bot/.venv/lib/python3.11/site-packages/webdriver_
manager/drivers/chrome.py", line 32, in get_driver_download_url
    driver_version_to_download = self.get_driver_version_to_download()
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dmytro.soltusyuk/Work/personal/atlant_bot/.venv/lib/python3.11/site-packages/webdriver_
manager/core/driver.py", line 48, in get_driver_version_to_download
    return self.get_latest_release_version()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dmytro.soltusyuk/Work/personal/atlant_bot/.venv/lib/python3.11/site-packages/webdriver_
manager/drivers/chrome.py", line 64, in get_latest_release_version
    determined_browser_version = ".".join(determined_browser_version.split(".")[:3])
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'split'

UPD: After installing the Chromium browser to the system, have an error, which looks closer to the one described in the issue:

  File "/Users/dmytro.soltusyuk/Work/personal/atlant_bot/atlant_bot/parser.py", line 22, in get_driver
    ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install()
  File "/Users/dmytro.soltusyuk/Work/personal/atlant_bot/.venv/lib/python3.11/site-packages/webdriver_manager/chrome.py", line 40, in install
    driver_path = self._get_driver_binary_path(self.driver)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dmytro.soltusyuk/Work/personal/atlant_bot/.venv/lib/python3.11/site-packages/webdriver_manager/core/manager.py", line 35, in _get_driver_binary_path
    binary_path = self._cache_manager.find_driver(driver)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dmytro.soltusyuk/Work/personal/atlant_bot/.venv/lib/python3.11/site-packages/webdriver_manager/core/driver_cache.py", line 105, in find_driver
    driver_version = self.get_cache_key_driver_version(driver)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dmytro.soltusyuk/Work/personal/atlant_bot/.venv/lib/python3.11/site-packages/webdriver_manager/core/driver_cache.py", line 152, in get_cache_key_driver_version
    return driver.get_driver_version_to_download()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dmytro.soltusyuk/Work/personal/atlant_bot/.venv/lib/python3.11/site-packages/webdriver_manager/core/driver.py", line 48, in get_driver_version_to_download
    return self.get_latest_release_version()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dmytro.soltusyuk/Work/personal/atlant_bot/.venv/lib/python3.11/site-packages/webdriver_manager/drivers/chrome.py", line 61, in get_latest_release_version
    determined_browser_version = response_dict.get("builds").get(determined_browser_version).get("version")
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

What this tells me is trying to use google's release version json isn't sufficient for chromium releases. Which, I think, makes some sense since chromium releases before google does. The question is, is there a release source for chromium that can be used instead?

What is really nuts about this is you can pull down the 'latest' version of chromium here : https://download-chromium.appspot.com/?platform=Mac_Arm&type=snapshots

..but the version you get doesn't even appear on https://omahaproxy.appspot.com/

Which is one of the sources mentioned for trying to find the version you want on the chromium documentation site: https://www.chromium.org/getting-involved/download-chromium/

This issue is compounded by the fact that installers like homebrew use this same source to install chromium on mac.

I'm curious if it would be a completely terrible idea to pull down the 'closest match' chromedriver in these cases?

commented

IDK exactly if it's your case, but in version 4.10 of Selenium, Selenium Manager is included by default.
More Info: https://stackoverflow.com/a/76725606

commented

when i use ChromeDriverManager on ubuntu docker
i have installed chromium

then i get this kind of error
bash cmd cannot find google-chrome

I think ChromeDriverManager have to use two chrome_type options

webdriver_manager/core/os_manager.py

class ChromeDriverManager(DriverManager):
    def __init__(
            self,
            ...
            chrome_type: list = [ChromeType.GOOGLE, ChromeType.CHROMIUM],
    ):

@Devosin that would be a different problem.

IDK exactly if it's your case, but in version 4.10 of Selenium, Selenium Manager is included by default. More Info: https://stackoverflow.com/a/76725606

@AlbertoFDR I appreciate the suggestion, even if it basically advises to ditch using this library.
But I opened #637 to help fix a problem with webdriver_manager.