compatibility linux and mac
This commit is contained in:
parent
c73b1c8e23
commit
cbe27643d0
|
@ -166,18 +166,20 @@ class ChromeDriverManager(object):
|
||||||
:return: on success, name of the unpacked executable
|
:return: on success, name of the unpacked executable
|
||||||
"""
|
"""
|
||||||
base_ = "chromedriver{}"
|
base_ = "chromedriver{}"
|
||||||
exe_name = base_.format(".exe")
|
|
||||||
zip_name = base_.format(".zip")
|
|
||||||
ver = self.get_release_version_number()
|
|
||||||
_platform = self.platform
|
_platform = self.platform
|
||||||
|
if _platform in ('win32',):
|
||||||
|
exe_name = base_.format(".exe")
|
||||||
if _platform in ('linux',):
|
if _platform in ('linux',):
|
||||||
_platform+='64'
|
_platform+='64'
|
||||||
if _platform in ('darwin',):
|
if _platform in ('darwin',):
|
||||||
_platform = 'mac64'
|
_platform = 'mac64'
|
||||||
|
|
||||||
|
zip_name = base_.format(".zip")
|
||||||
|
ver = self.get_release_version_number()
|
||||||
if os.path.exists(exe_name):
|
if os.path.exists(exe_name):
|
||||||
return exe_name
|
return exe_name
|
||||||
urlretrieve(
|
urlretrieve(
|
||||||
f"{_DL_BASE}{ver}/{base_.format(f'_{self.platform}')}.zip",
|
f"{_DL_BASE}{ver}/{base_.format(f'_{_platform}')}.zip",
|
||||||
filename=zip_name,
|
filename=zip_name,
|
||||||
)
|
)
|
||||||
with zipfile.ZipFile(zip_name) as zf:
|
with zipfile.ZipFile(zip_name) as zf:
|
||||||
|
|
Loading…
Reference in New Issue