1
+ import logging
1
2
import os
2
3
import random
3
4
import re
@@ -519,8 +520,8 @@ def get_local_driver(
519
520
try :
520
521
make_driver_executable_if_not (LOCAL_GECKODRIVER )
521
522
except Exception as e :
522
- print ("\n Warning: Could not make geckodriver"
523
- " executable: %s" % e )
523
+ logging . debug ("\n Warning: Could not make geckodriver"
524
+ " executable: %s" % e )
524
525
elif not is_geckodriver_on_path ():
525
526
if not "" .join (sys .argv ) == "-c" : # Skip if multithreaded
526
527
from seleniumbase .console_scripts import sb_install
@@ -563,11 +564,19 @@ def get_local_driver(
563
564
ie_options .persistent_hover = True
564
565
ie_capabilities = ie_options .to_capabilities ()
565
566
if LOCAL_IEDRIVER and os .path .exists (LOCAL_IEDRIVER ):
566
- make_driver_executable_if_not (LOCAL_IEDRIVER )
567
+ try :
568
+ make_driver_executable_if_not (LOCAL_IEDRIVER )
569
+ except Exception as e :
570
+ logging .debug ("\n Warning: Could not make iedriver"
571
+ " executable: %s" % e )
567
572
return webdriver .Ie (capabilities = ie_capabilities )
568
573
elif browser_name == constants .Browser .EDGE :
569
574
if LOCAL_EDGEDRIVER and os .path .exists (LOCAL_EDGEDRIVER ):
570
- make_driver_executable_if_not (LOCAL_EDGEDRIVER )
575
+ try :
576
+ make_driver_executable_if_not (LOCAL_EDGEDRIVER )
577
+ except Exception as e :
578
+ logging .debug ("\n Warning: Could not make edgedriver"
579
+ " executable: %s" % e )
571
580
# The new Microsoft Edge browser is based on Chromium
572
581
chrome_options = _set_chrome_options (
573
582
downloads_path , headless ,
@@ -585,7 +594,11 @@ def get_local_driver(
585
594
return webdriver .Safari ()
586
595
elif browser_name == constants .Browser .OPERA :
587
596
if LOCAL_OPERADRIVER and os .path .exists (LOCAL_OPERADRIVER ):
588
- make_driver_executable_if_not (LOCAL_OPERADRIVER )
597
+ try :
598
+ make_driver_executable_if_not (LOCAL_OPERADRIVER )
599
+ except Exception as e :
600
+ logging .debug ("\n Warning: Could not make operadriver"
601
+ " executable: %s" % e )
589
602
return webdriver .Opera ()
590
603
elif browser_name == constants .Browser .PHANTOM_JS :
591
604
with warnings .catch_warnings ():
@@ -601,7 +614,11 @@ def get_local_driver(
601
614
extension_zip , extension_dir , servername , mobile_emulator ,
602
615
device_width , device_height , device_pixel_ratio )
603
616
if LOCAL_CHROMEDRIVER and os .path .exists (LOCAL_CHROMEDRIVER ):
604
- make_driver_executable_if_not (LOCAL_CHROMEDRIVER )
617
+ try :
618
+ make_driver_executable_if_not (LOCAL_CHROMEDRIVER )
619
+ except Exception as e :
620
+ logging .debug ("\n Warning: Could not make chromedriver"
621
+ " executable: %s" % e )
605
622
elif not is_chromedriver_on_path ():
606
623
if not "" .join (sys .argv ) == "-c" : # Skip if multithreaded
607
624
from seleniumbase .console_scripts import sb_install
@@ -614,7 +631,11 @@ def get_local_driver(
614
631
if headless :
615
632
raise Exception (e )
616
633
if LOCAL_CHROMEDRIVER and os .path .exists (LOCAL_CHROMEDRIVER ):
617
- make_driver_executable_if_not (LOCAL_CHROMEDRIVER )
634
+ try :
635
+ make_driver_executable_if_not (LOCAL_CHROMEDRIVER )
636
+ except Exception as e :
637
+ logging .debug ("\n Warning: Could not make chromedriver"
638
+ " executable: %s" % e )
618
639
return webdriver .Chrome ()
619
640
else :
620
641
raise Exception (
0 commit comments