【问题标题】:phantomjs fails to start with supervisordphantomjs 无法从 supervisord 开始
【发布时间】:2018-05-26 13:37:48
【问题描述】:

我最近向我的机器人添加了一个 selenium.webdriver.PhantomJS() 对象,用于抓取。但是当我使用supervisord 启动我的机器人时,它立即崩溃并出现错误 127。我到处搜索,但没有找到任何相关信息。我已经安装了所有必需的库(libfreetype6libfontconfig)。

仅当我通过主管启动我的机器人脚本时才会发生这种情况,并且我需要它来自动启动/重新启动。

我得到的确切错误:selenium.common.exceptions.WebDriverException: Message: Service phantomjs unexpectedly exited. Status code was 127

PhantomJS 版本:2.1.1(通过 npm 安装)

npm 版本:5.6.0

启动 webdriver 的代码行:

self.utilities = {} # this happens inside the class
self.phantom_path = '/home/maxlunar/node_modules/phantomjs/bin/phantomjs'
self.utilities.update({'webdriver': PhantomJS(executable_path=self.phantom_path)})

如果需要,我可以提供更多信息。

【问题讨论】:

    标签: python selenium-webdriver phantomjs supervisord


    【解决方案1】:

    问题出在错误的可执行文件中。我用的是...phantomjs/bin/phantomjs,但正确的二进制是...phantomjs/lib/phantom/bin/phantomjs

    【讨论】:

      猜你喜欢
      • 2021-11-28
      • 2013-07-22
      • 1970-01-01
      • 1970-01-01
      • 2012-08-14
      • 1970-01-01
      相关资源
      最近更新 更多