From 9dde6b4ce75aefca67aa09ba1dd23f6d310c9e61 Mon Sep 17 00:00:00 2001 From: g1879 Date: Mon, 23 Nov 2020 15:12:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/easy_set.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/DrissionPage/easy_set.py b/DrissionPage/easy_set.py index 417204f..dc86940 100644 --- a/DrissionPage/easy_set.py +++ b/DrissionPage/easy_set.py @@ -53,8 +53,7 @@ def set_paths(driver_path: str = None, om = OptionsManager(ini_path) def format_path(path: str) -> str: - if isinstance(path, str): - return path.replace('/', '\\') + return str(path).replace('/', '\\') if driver_path is not None: om.set_item('paths', 'chromedriver_path', format_path(driver_path)) @@ -169,7 +168,7 @@ def check_driver_version(driver_path: str = None, chrome_path: str = None) -> bo print('正在检测可用性...') om = OptionsManager() driver_path = driver_path or om.get_value('paths', 'chromedriver_path') or 'chromedriver' - chrome_path = chrome_path or om.get_value('chrome_options', 'binary_location') + chrome_path = str(chrome_path or om.get_value('chrome_options', 'binary_location')) do = DriverOptions(read_file=False) do.add_argument('--headless')