33
44Usage:
55 sbase get {chromedriver|geckodriver|edgedriver|
6- iedriver|operadriver } [OPTIONS]
6+ iedriver|uc_driver } [OPTIONS]
77Options:
88 VERSION Specify the version.
99 Tries to detect the needed version.
1616 sbase get edgedriver
1717 sbase get chromedriver 114
1818 sbase get chromedriver 114.0.5735.90
19+ sbase get chromedriver stable
20+ sbase get chromedriver beta
1921 sbase get chromedriver -p
2022Output:
2123 Downloads the webdriver to seleniumbase/drivers/
5052DEFAULT_CHROMEDRIVER_VERSION = "114.0.5735.90" # (If can't find LATEST_STABLE)
5153DEFAULT_GECKODRIVER_VERSION = "v0.33.0"
5254DEFAULT_EDGEDRIVER_VERSION = "115.0.1901.183" # (If can't find LATEST_STABLE)
53- DEFAULT_OPERADRIVER_VERSION = "v.96.0.4664.45"
5455
5556
5657def invalid_run_command ():
@@ -61,7 +62,7 @@ def invalid_run_command():
6162 exp += " OR seleniumbase get [DRIVER] [OPTIONS]\n "
6263 exp += " OR sbase get [DRIVER] [OPTIONS]\n "
6364 exp += " (Drivers: chromedriver, geckodriver, edgedriver,\n "
64- exp += " iedriver, operadriver, uc_driver)\n "
65+ exp += " iedriver, uc_driver)\n "
6566 exp += " Options:\n "
6667 exp += " VERSION Specify the version.\n "
6768 exp += " Tries to detect the needed version.\n "
@@ -287,7 +288,6 @@ def main(override=None, intel_for_uc=None, force_uc=None):
287288 downloads_folder = DRIVER_DIR
288289 expected_contents = None
289290 platform_code = None
290- inner_folder = None
291291 copy_to_path = False
292292 latest_version = ""
293293 use_version = ""
@@ -717,7 +717,7 @@ def main(override=None, intel_for_uc=None, force_uc=None):
717717 else :
718718 raise Exception (
719719 "Sorry! IEDriver is only for "
720- "Windows-based operating systems!"
720+ "Windows-based systems!"
721721 )
722722 download_url = (
723723 "https://selenium-release.storage.googleapis.com/"
@@ -736,71 +736,6 @@ def main(override=None, intel_for_uc=None, force_uc=None):
736736 msg = c2 + "HeadlessIEDriver to download" + cr
737737 p_version = c3 + headless_ie_version + cr
738738 log_d ("\n *** %s = %s" % (msg , p_version ))
739- elif name == "operadriver" or name == "operachromiumdriver" :
740- name = "operadriver"
741- use_version = DEFAULT_OPERADRIVER_VERSION
742- get_latest = False
743- if num_args == 4 or num_args == 5 :
744- if "-p" not in sys .argv [3 ].lower ():
745- use_version = sys .argv [3 ]
746- if use_version .lower () == "latest" :
747- use_version = DEFAULT_OPERADRIVER_VERSION
748- else :
749- copy_to_path = True
750- if num_args == 5 :
751- if "-p" in sys .argv [4 ].lower ():
752- copy_to_path = True
753- else :
754- invalid_run_command ()
755- if IS_MAC :
756- file_name = "operadriver_mac64.zip"
757- platform_code = "mac64"
758- inner_folder = "operadriver_%s/" % platform_code
759- expected_contents = [
760- "operadriver_mac64/" ,
761- "operadriver_mac64/operadriver" ,
762- "operadriver_mac64/sha512_sum" ,
763- ]
764- elif IS_LINUX :
765- file_name = "operadriver_linux64.zip"
766- platform_code = "linux64"
767- inner_folder = "operadriver_%s/" % platform_code
768- expected_contents = [
769- "operadriver_linux64/" ,
770- "operadriver_linux64/operadriver" ,
771- "operadriver_linux64/sha512_sum" ,
772- ]
773- elif IS_WINDOWS and "64" in ARCH :
774- file_name = "operadriver_win64.zip"
775- platform_code = "win64"
776- inner_folder = "operadriver_%s/" % platform_code
777- expected_contents = [
778- "operadriver_win64/" ,
779- "operadriver_win64/operadriver.exe" ,
780- "operadriver_win64/sha512_sum" ,
781- ]
782- elif IS_WINDOWS :
783- file_name = "operadriver_win32.zip"
784- platform_code = "win32"
785- inner_folder = "operadriver_%s/" % platform_code
786- expected_contents = [
787- "operadriver_win32/" ,
788- "operadriver_win32/operadriver.exe" ,
789- "operadriver_win32/sha512_sum" ,
790- ]
791- else :
792- raise Exception (
793- "Cannot determine which version of Operadriver to download!"
794- )
795-
796- download_url = (
797- "https://github.com/operasoftware/operachromiumdriver/"
798- "releases/download/"
799- "%s/%s" % (use_version , file_name )
800- )
801- msg = c2 + "operadriver to download" + cr
802- p_version = c3 + use_version + cr
803- log_d ("\n *** %s = %s" % (msg , p_version ))
804739 else :
805740 invalid_run_command ()
806741
@@ -1095,60 +1030,6 @@ def main(override=None, intel_for_uc=None, force_uc=None):
10951030 make_executable (path_file )
10961031 log_d ("Also copied to: %s%s%s" % (c3 , path_file , cr ))
10971032 log_d ("" )
1098- elif name == "operadriver" :
1099- if len (contents ) > 3 :
1100- raise Exception ("Unexpected content in OperaDriver Zip file!" )
1101- # Zip file is valid. Proceed.
1102- driver_path = None
1103- driver_file = None
1104- for f_name in contents :
1105- # Remove existing version if exists
1106- str_name = str (f_name ).split (inner_folder )[1 ]
1107- new_file = os .path .join (downloads_folder , str_name )
1108- if str_name == "operadriver" or str_name == "operadriver.exe" :
1109- driver_file = str_name
1110- driver_path = new_file
1111- if os .path .exists (new_file ):
1112- os .remove (new_file )
1113- if not driver_file or not driver_path :
1114- raise Exception ("Operadriver missing from Zip file!" )
1115- log_d ("Extracting %s from %s ..." % (contents , file_name ))
1116- zip_ref .extractall (downloads_folder )
1117- zip_ref .close ()
1118- os .remove (zip_file_path )
1119- log_d ("%sUnzip Complete!%s\n " % (c2 , cr ))
1120- inner_driver = os .path .join (
1121- downloads_folder , inner_folder , driver_file
1122- )
1123- inner_sha = os .path .join (
1124- downloads_folder , inner_folder , "sha512_sum"
1125- )
1126- shutil .copyfile (inner_driver , driver_path )
1127- pr_driver_path = c3 + driver_path + cr
1128- log_d (
1129- "The file [%s] was saved to:\n %s\n "
1130- % (driver_file , pr_driver_path )
1131- )
1132- log_d ("Making [%s %s] executable ..." % (driver_file , use_version ))
1133- make_executable (driver_path )
1134- log_d (
1135- "%s[%s %s] is now ready for use!%s"
1136- % (c1 , driver_file , use_version , cr )
1137- )
1138- if copy_to_path and os .path .exists (LOCAL_PATH ):
1139- path_file = LOCAL_PATH + driver_file
1140- shutil .copyfile (driver_path , path_file )
1141- make_executable (path_file )
1142- log_d ("Also copied to: %s%s%s" % (c3 , path_file , cr ))
1143- # Clean up extra files
1144- if os .path .exists (inner_driver ):
1145- os .remove (inner_driver )
1146- if os .path .exists (inner_sha ):
1147- os .remove (inner_sha )
1148- if os .path .exists (os .path .join (downloads_folder , inner_folder )):
1149- # Only works if the directory is empty
1150- os .rmdir (os .path .join (downloads_folder , inner_folder ))
1151- log_d ("" )
11521033 elif len (contents ) == 0 :
11531034 raise Exception ("Zip file %s is empty!" % zip_file_path )
11541035 else :
0 commit comments