python – Cant install selenium webdriver manager

I tried below code as usual to install selenium webdriver for chrom -windows but got attribute error. I could not find the similar issue happened to other.

Input:

# selenium 4
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager

Expected output: to Install the driver

Output:


      3 from selenium.webdriver.chrome.service import Service as ChromeService
      4 from webdriver_manager.chrome import ChromeDriverManager
----> 6 driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()))

File c:\Users\Togrul Kazimov\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\chrome.py:40, in ChromeDriverManager.install(self)
     39 def install(self) -> str:
---> 40     driver_path = self._get_driver_binary_path(self.driver)
     41     os.chmod(driver_path, 0o755)
     42     return driver_path

File c:\Users\Togrul Kazimov\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\manager.py:40, in DriverManager._get_driver_binary_path(self, driver)
     37     return binary_path
     39 os_type = self.get_os_type()
---> 40 file = self._download_manager.download_file(driver.get_driver_download_url(os_type))
     41 binary_path = self._cache_manager.save_file_to_cache(driver, file)
     42 return binary_path

File c:\Users\Togrul Kazimov\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\drivers\chrome.py:32, in ChromeDriver.get_driver_download_url(self, os_type)
     31 def get_driver_download_url(self, os_type):
---> 32     driver_version_to_download = self.get_driver_version_to_download()
     33     # For Mac ARM CPUs after version 106.0.5249.61 the format of OS type changed
     34     # to more unified "mac_arm64". For newer versions, it'll be "mac_arm64"
     35     # by default, for lower versions we replace "mac_arm64" to old format - "mac64_m1".
     36     if version.parse(driver_version_to_download) < version.parse("106.0.5249.61"):

File c:\Users\Togrul Kazimov\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\driver.py:48, in Driver.get_driver_version_to_download(self)
     45 if self._driver_version_to_download:
     46     return self._driver_version_to_download
---> 48 return self.get_latest_release_version()

File c:\Users\Togrul Kazimov\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\drivers\chrome.py:64, in ChromeDriver.get_latest_release_version(self)
     62     return determined_browser_version
     63 # Remove the build version (the last segment) from determined_browser_version for version < 113
---> 64 determined_browser_version = ".".join(determined_browser_version.split(".")[:3])
     65 latest_release_url = (
     66     self._latest_release_url
     67     if (determined_browser_version is None)
     68     else f"{self._latest_release_url}_{determined_browser_version}"
     69 )
     70 resp = self._http_client.get(url=latest_release_url)

AttributeError: 'NoneType' object has no attribute 'split'

Read more here: Source link