From 3104eb67ade3ccfce6011dd5a4bf9ee67e7f2e4d Mon Sep 17 00:00:00 2001 From: g1879 <g1879@qq.com> Date: Tue, 30 Nov 2021 16:47:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4/=E6=9B=BF=E6=8D=A2=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E9=80=82=E5=BA=94linux=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/config.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/DrissionPage/config.py b/DrissionPage/config.py index 6f11de1..9fb071b 100644 --- a/DrissionPage/config.py +++ b/DrissionPage/config.py @@ -612,27 +612,23 @@ class DriverOptions(Options): :param cache_path: 缓存路径 :return: 当前对象 """ - - def format_path(path: str) -> str: - return path.replace('/', '\\') - if driver_path is not None: - self._driver_path = format_path(driver_path) + self._driver_path = driver_path if chrome_path is not None: - self.binary_location = format_path(chrome_path) + self.binary_location = chrome_path if debugger_address is not None: self.debugger_address = debugger_address if download_path is not None: - self.experimental_options['prefs']['download.default_directory'] = format_path(download_path) + self.experimental_options['prefs']['download.default_directory'] = download_path if user_data_path is not None: - self.set_argument('--user-data-dir', format_path(user_data_path)) + self.set_argument('--user-data-dir', user_data_path) if cache_path is not None: - self.set_argument('--disk-cache-dir', format_path(cache_path)) + self.set_argument('--disk-cache-dir', cache_path) return self