我正在我的计算机上运行我的 wxPython exe,它可以很好地使用 PhantomJS。但是,当我将其发送到另一台计算机后,它给出了以下错误。如果这是 Python 库中的标准包或模块,我就能弄清楚这一点,但 PhantomJS 看起来相当复杂。我是否需要在 py2exe 设置中包含某些内容才能使 phantomjs.exe 与我的应用程序一起使用?或者我只是将 phantomjs.exe 包含在我的 dist 文件夹中?
File "selenium\webdriver\phantomjs\webdriver.pyc", line 50, in __init__
File "selenium\webdriver\phantomjs\service.pyc", line 67, in start
WebDriverException: Message: 'Unable to start phantomjs with ghostdriver.' ; Screenshot: available via screen
非常感谢!关于 py2exe 和 phantomjs 的可用信息不多。
最佳答案
为了解决这个问题,我无法通过 py2exe 找到解决方案,因此我手动将 phantomjs 的路径更改为“phantomjs.exe”,然后手动将其复制到我的分发文件夹中。然后我将其压缩并顺利运送给最终用户。
关于python - PhantomJS 可以与 py2exe 一起使用吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23482787/