@@ -3058,22 +3058,22 @@ def get_driver(
30583058):
30593059 sb_config ._ext_dirs = []
30603060 driver_dir = DRIVER_DIR
3061- if getattr (sb_config , "binary_location" , None ) == "cft" :
3061+ if binary_location == "_chromium_" :
3062+ driver_dir = DRIVER_DIR_CHROMIUM
3063+ elif binary_location == "cft" :
30623064 driver_dir = DRIVER_DIR_CFT
3063- if getattr ( sb_config , " binary_location" , None ) == "chs" :
3065+ elif binary_location == "chs" :
30643066 driver_dir = DRIVER_DIR_CHS
3065- if getattr (sb_config , "binary_location" , None ) == "_chromium_" :
3066- driver_dir = DRIVER_DIR_CHROMIUM
3067- if _special_binary_exists (binary_location , "opera" ):
3067+ elif _special_binary_exists (binary_location , "opera" ):
30683068 driver_dir = DRIVER_DIR_OPERA
30693069 sb_config ._cdp_browser = "opera"
3070- if _special_binary_exists (binary_location , "brave" ):
3070+ elif _special_binary_exists (binary_location , "brave" ):
30713071 driver_dir = DRIVER_DIR_BRAVE
30723072 sb_config ._cdp_browser = "brave"
3073- if _special_binary_exists (binary_location , "comet" ):
3073+ elif _special_binary_exists (binary_location , "comet" ):
30743074 driver_dir = DRIVER_DIR_COMET
30753075 sb_config ._cdp_browser = "comet"
3076- if _special_binary_exists (binary_location , "atlas" ):
3076+ elif _special_binary_exists (binary_location , "atlas" ):
30773077 driver_dir = DRIVER_DIR_ATLAS
30783078 sb_config ._cdp_browser = "atlas"
30793079 if (
@@ -4099,27 +4099,31 @@ def get_local_driver(
40994099 downloads_path = DOWNLOADS_FOLDER
41004100 driver_dir = DRIVER_DIR
41014101 special_chrome = False
4102- if getattr (sb_config , "binary_location" , None ) == "_chromium_" :
4103- special_chrome = True
4104- driver_dir = DRIVER_DIR_CHROMIUM
4105- if getattr (sb_config , "binary_location" , None ) == "cft" :
4106- special_chrome = True
4107- driver_dir = DRIVER_DIR_CFT
4108- if getattr (sb_config , "binary_location" , None ) == "chs" :
4109- special_chrome = True
4110- driver_dir = DRIVER_DIR_CHS
4111- if _special_binary_exists (binary_location , "opera" ):
4112- special_chrome = True
4113- driver_dir = DRIVER_DIR_OPERA
4114- if _special_binary_exists (binary_location , "brave" ):
4115- special_chrome = True
4116- driver_dir = DRIVER_DIR_BRAVE
4117- if _special_binary_exists (binary_location , "comet" ):
4118- special_chrome = True
4119- driver_dir = DRIVER_DIR_COMET
4120- if _special_binary_exists (binary_location , "atlas" ):
4121- special_chrome = True
4122- driver_dir = DRIVER_DIR_ATLAS
4102+ if binary_location :
4103+ if (
4104+ binary_location == "_chromium_"
4105+ or "chromium_drivers" in binary_location
4106+ ):
4107+ special_chrome = True
4108+ driver_dir = DRIVER_DIR_CHROMIUM
4109+ elif binary_location == "cft" or "cft_drivers" in binary_location :
4110+ special_chrome = True
4111+ driver_dir = DRIVER_DIR_CFT
4112+ elif binary_location == "chs" or "chs_drivers" in binary_location :
4113+ special_chrome = True
4114+ driver_dir = DRIVER_DIR_CHS
4115+ elif _special_binary_exists (binary_location , "opera" ):
4116+ special_chrome = True
4117+ driver_dir = DRIVER_DIR_OPERA
4118+ elif _special_binary_exists (binary_location , "brave" ):
4119+ special_chrome = True
4120+ driver_dir = DRIVER_DIR_BRAVE
4121+ elif _special_binary_exists (binary_location , "comet" ):
4122+ special_chrome = True
4123+ driver_dir = DRIVER_DIR_COMET
4124+ elif _special_binary_exists (binary_location , "atlas" ):
4125+ special_chrome = True
4126+ driver_dir = DRIVER_DIR_ATLAS
41234127 if (
41244128 hasattr (sb_config , "settings" )
41254129 and getattr (sb_config .settings , "NEW_DRIVER_DIR" , None )
0 commit comments