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

Fix unhandled AttributeError when chrome browser version cannot be determined #638

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}"
)

if determined_browser_version is None:
latest_release_url = self._latest_release_url
else:
# 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}"
resp = self._http_client.get(url=latest_release_url)
return resp.text.rstrip()

Expand Down
Loading