From ac43a1098e182f5d0aa5049b121d6d5f0964c1f5 Mon Sep 17 00:00:00 2001 From: yousiki Date: Thu, 11 Mar 2021 14:26:35 +0800 Subject: [PATCH] fix? --- entrypoint.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/entrypoint.py b/entrypoint.py index f2185f4..c8fefc9 100644 --- a/entrypoint.py +++ b/entrypoint.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +import os import sys import argparse import warnings @@ -11,13 +12,13 @@ def sys_path(): - path = './phantomjs/bin/' + path = os.path.join(os.getcwd(), 'phantomjs', 'bin') if sys.platform.startswith('win'): - return path + 'phantomjs.exe' + return os.path.join(path, 'phantomjs.exe') elif sys.platform.startswith('linux'): - return path + 'phantomjs-linux' + return os.path.join(path, 'phantomjs-linux') elif sys.platform.startswith('darwin'): - return path + 'phantomjs' + return os.path.join(path, 'phantomjs') else: raise Exception('暂不支持该系统') @@ -38,6 +39,7 @@ def sys_path(): args = parser.parse_args() print('Driver Launching...') + assert os.path.isfile(sys_path()) driver_pjs = webdriver.PhantomJS( executable_path=sys_path(), service_args=['--ignore-ssl-errors=true', '--ssl-protocol=TLSv1'])