From b08f45bdc83ac0c908d257b5c7cdd78278508eab Mon Sep 17 00:00:00 2001 From: projectdx Date: Tue, 27 Sep 2022 13:15:55 +0900 Subject: [PATCH] =?UTF-8?q?=EC=95=A0=EB=8B=88=EB=9D=BC=EC=9D=B4=ED=94=84?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EC=95=A0=EB=8B=8824=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=202022.09.25?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit os platform fix --- logic_anilife.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/logic_anilife.py b/logic_anilife.py index 132f556..c52dc41 100644 --- a/logic_anilife.py +++ b/logic_anilife.py @@ -393,7 +393,7 @@ class LogicAniLife(LogicModuleBase): options.add_experimental_option("excludeSwitches", ["enable-automation"]) options.add_experimental_option("useAutomationExtension", False) - if LogicAniLife.os_platform == 'Darwin': + if LogicAniLife.os_platform == "Darwin": # 크롬드라이버 경로 driver_path = "./bin/Darwin/chromedriver" # driver = webdriver.Chrome(executable_path=driver_path, chrome_options=options) @@ -401,8 +401,13 @@ class LogicAniLife(LogicModuleBase): ChromeDriverManager().install(), chrome_options=options ) else: - driver_path = f"./bin/{LogicAniLife.os_platform}/chromedriver" - driver = webdriver.Chrome(executable_path=driver_path, chrome_options=options) + driver_bin_path = os.path.join( + os.path.dirname(__file__), "bin", f"{LogicAniLife.os_platform}" + ) + driver_path = f"{driver_bin_path}/chromedriver" + driver = webdriver.Chrome( + executable_path=driver_path, chrome_options=options + ) stealth( driver,