Skip to content

Commit f820256

Browse files
committed
Add ability to install EdgeDriver without knowing full version
1 parent 6e2767c commit f820256

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

seleniumbase/console_scripts/sb_install.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,18 +324,29 @@ def main(override=None):
324324
use_version = url_request.text.split("\r")[0].split("\n")[0]
325325
else:
326326
use_version = DEFAULT_EDGEDRIVER_VERSION
327+
suffix = None
327328
if "win64" in sys_plat or "x64" in sys_plat:
328329
file_name = "edgedriver_win64.zip"
330+
suffix = "WINDOWS"
329331
elif "win32" in sys_plat or "x86" in sys_plat:
330332
file_name = "edgedriver_win32.zip"
333+
suffix = "WINDOWS"
331334
elif "darwin" in sys_plat:
332335
file_name = "edgedriver_mac64.zip"
336+
suffix = "MACOS"
333337
elif "linux" in sys_plat:
334338
file_name = "edgedriver_linux64.zip"
339+
suffix = "LINUX"
335340
else:
336341
raise Exception(
337342
"Cannot determine which version of EdgeDriver to download!"
338343
)
344+
if use_version.isdigit():
345+
edgedriver_st = "https://msedgedriver.azureedge.net/LATEST_RELEASE"
346+
use_version = "%s_%s_%s" % (edgedriver_st, use_version, suffix)
347+
url_request = requests.get(use_version)
348+
if url_request.ok:
349+
use_version = url_request.text.split("\r")[0].split("\n")[0]
339350
download_url = "https://msedgedriver.azureedge.net/%s/%s" % (
340351
use_version,
341352
file_name,

0 commit comments

Comments
 (0)