From 8be8a836c9e222e45745811a3c46db2b1cbb1d37 Mon Sep 17 00:00:00 2001 From: Jeff C Date: Sun, 8 Mar 2020 11:42:37 -0700 Subject: [PATCH] let Selenium try to find chromedriver (in PATH) --- deletefb/tools/chrome_driver.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/deletefb/tools/chrome_driver.py b/deletefb/tools/chrome_driver.py index 94d2c4d..353c872 100644 --- a/deletefb/tools/chrome_driver.py +++ b/deletefb/tools/chrome_driver.py @@ -60,10 +60,13 @@ def extract_zip(filename, chrome_maj_version): def setup_selenium(options, chrome_binary_path): - # Configures selenium to use a custom path - driver_path = get_webdriver(chrome_binary_path) - - return webdriver.Chrome(executable_path=driver_path, options=options) + try: + # try letting Selenium find the driver (in PATH) + return webdriver.Chrome(options=options) + except WebDriverException: + # Configures selenium to use a custom path + driver_path = get_webdriver(chrome_binary_path) + return webdriver.Chrome(executable_path=driver_path, options=options) def parse_version(output): """ -- 2.30.2