【发布时间】:2014-08-04 20:22:00
【问题描述】:
我正在通过 cronjob 运行 python 脚本。我有一个虚拟环境,在 cronjob 中我通过这个虚拟环境运行它。当我正常运行脚本时,phantomJS 会正常启动,但是通过 cronjob 中的脚本运行它时会出现此错误。 cronjob 中缺少什么才能启动 phantomjs?
Message: 'Unable to start phantomjs with ghostdriver.' ; Screenshot: available via screen
Traceback (most recent call last):
File "/home/scraper/superfish-extension/chrome_3day.py", line 96, in <module>
main()
File "/home/scraper/superfish-extension/chrome_3day.py", line 73, in main
browser = use_phantomjs()
File "/home/scraper/superfish-extension/chrome.py", line 81, in use_phantomjs
browser = webdriver.PhantomJS()
File "/home/scraper/.virtualenvs/superfish/lib/python2.6/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 50, in __init__
self.service.start()
File "/home/scraper/.virtualenvs/superfish/lib/python2.6/site-packages/selenium/webdriver/phantomjs/service.py", line 69, in start
raise WebDriverException("Unable to start phantomjs with ghostdriver.", e)
WebDriverException: Message: 'Unable to start phantomjs with ghostdriver.' ; Screenshot: available via screen
【问题讨论】:
标签: python cron phantomjs crontab