使用cron时无法连接到PhantomJS

时间:2018-11-28 13:36:32

标签: python phantomjs

我能够在终端上运行脚本而不会出现问题,但是通过cron运行脚本时会收到以下错误:

driver = webdriver.PhantomJS(executable_path='/usr/local/bin/phantomjs')
File "/usr/lib/python2.6/site-packages/selenium-3.6.0-py2.6.egg/selenium/webdriver/phantomjs/webdriver.py", line 52, in __init__
self.service.start()
File "/usr/lib/python2.6/site-packages/selenium-3.6.0- 
py2.6.egg/selenium/webdriver/common/service.py", line 102, in start
raise WebDriverException("Can not connect to the Service %s" % self.path)
selenium.common.exceptions.WebDriverException: Message: Can not connect to the 
Service /usr/local/bin/phantomjs

知道为什么会这样吗?

0 个答案:

没有答案