环境:ubuntu16
现象:
使用phantomjs解析动态网页获取网页源码时,scrapy执行报错,报错信息如下:
selenium.common.exceptions.WebDriverException: Message: Service /usr/local/bin/phantomjs unexpectedly exited. Status code was: 127
看到spider所在目录有一个错误日志ghostdriver.log,里面的内容如下:
phantomjs: error while loading shared libraries: libfontconfig.so.1
解决方法:
sudo apt-get install fontconfig