From d3c1eb5999dbfbd93e913a184bb9052b49f358f1 Mon Sep 17 00:00:00 2001 From: Marc Bresson <50196352+MarcBresson@users.noreply.github.com> Date: Thu, 25 Jul 2024 10:11:29 +0200 Subject: [PATCH] FIX #649: get latest version for chrome when it's not installed (#655) Co-authored-by: Marc Bresson --- webdriver_manager/drivers/chrome.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/webdriver_manager/drivers/chrome.py b/webdriver_manager/drivers/chrome.py index 80d6f38e..595e64b5 100644 --- a/webdriver_manager/drivers/chrome.py +++ b/webdriver_manager/drivers/chrome.py @@ -60,13 +60,13 @@ def get_latest_release_version(self): response_dict = json.loads(response.text) determined_browser_version = response_dict.get("builds").get(determined_browser_version).get("version") return determined_browser_version - # Remove the build version (the last segment) from determined_browser_version for version < 113 - determined_browser_version = ".".join(determined_browser_version.split(".")[:3]) - latest_release_url = ( - self._latest_release_url - if (determined_browser_version is None) - else f"{self._latest_release_url}_{determined_browser_version}" - ) + elif determined_browser_version is not None: + # Remove the build version (the last segment) from determined_browser_version for version < 113 + determined_browser_version = ".".join(determined_browser_version.split(".")[:3]) + latest_release_url = f"{self._latest_release_url}_{determined_browser_version}" + else: + latest_release_url = self._latest_release_url + resp = self._http_client.get(url=latest_release_url) return resp.text.rstrip()