美文网首页
解决:Ubuntu(MacOS)+phantomjs+pytho

解决:Ubuntu(MacOS)+phantomjs+pytho

作者: Otis4631 | 来源:发表于2017-10-02 12:08 被阅读0次

QXcbConnection: Could not connect to displayPhantomJS has crashed. Please read the bug reporting guide athttp://phantomjs.org/bug-reporting.html and file a bug report.Aborted

解决方案
1. sudo apt-get install xvfb
2. sudo xvfb-run wkhtmltopdf

xvfb 是通过提供一个类似 X server 守护进程 和 设置程序运行的环境变量 DISPLAY 来提供程序运行的环境,wkhtmltopdf,把HTML页面内存转换成PDF

如按照上述步骤还未解决,请重启终端!
致谢
QXcbConnection: Could not connect to display Aborted phantomjs资源下载

相关文章

网友评论

      本文标题:解决:Ubuntu(MacOS)+phantomjs+pytho

      本文链接:https://www.haomeiwen.com/subject/raozextx.html