Skip to content

Commit

Permalink
FIX #649: get latest version for chrome when it's not installed (#655)
Browse files Browse the repository at this point in the history
Co-authored-by: Marc Bresson <[email protected]>
  • Loading branch information
MarcBresson and MarcBresson authored Jul 25, 2024
1 parent 3280b00 commit d3c1eb5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions webdriver_manager/drivers/chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit d3c1eb5

Please sign in to comment.