Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
YOUSIKI committed Mar 11, 2021
1 parent aedc55c commit ac43a10
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions entrypoint.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python

import os
import sys
import argparse
import warnings
Expand All @@ -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('暂不支持该系统')

Expand All @@ -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'])
Expand Down

0 comments on commit ac43a10

Please sign in to comment.