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 IE download due to corrupt filename in googleapis repo #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions src/webdrivermanager/ie.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class IEDriverManager(WebDriverManagerBase):
"""Class for downloading Internet Explorer WebDriver."""

ie_driver_base_url = "https://selenium-release.storage.googleapis.com"
file_name_regex = r".*\/IEDriverServer_(x64|Win32)_(\d+\.\d+\.\d+)\.zip"
_drivers = None
_versions = None

Expand Down Expand Up @@ -63,7 +64,7 @@ def get_compatible_version(self):
raise NotImplementedError

def _extract_ver(self, s):
matcher = r".*\/IEDriverServer_(x64|Win32)_(\d+\.\d+\.\d+)\.zip"
matcher = self.file_name_regex
ret = re.match(matcher, s)
return ret.group(2)

Expand All @@ -73,6 +74,6 @@ def _populate_cache(self, url):
raise_runtime_error(f"Error, unable to get version number for latest release, got code: {resp.status_code}")

soup = BeautifulSoup(resp.text, "lxml")
drivers = filter(lambda entry: "IEDriverServer_" in entry.contents[0], soup.find_all("key"))
drivers = filter(lambda entry: re.match(self.file_name_regex, entry.contents[0]), soup.find_all("key"))
self._drivers = list(map(lambda entry: entry.contents[0], drivers))
self._versions = set(map(lambda entry: versiontuple(self._extract_ver(entry)), self._drivers))