解决:Ubuntu(MacOS)+phantomjs+pytho

2017-10-02  本文已影响0人  Otis4631

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资源下载

上一篇 下一篇

猜你喜欢

热点阅读