1.前言 想使用selenium从网站上抓数据,但有时候使用phantomjs会出错。chrome现在也有无界面运行模式了,以后就可以不用phantomjs了。 但在服务器安装chrome时出现了一些错误,这里总结一下整个安装过程 2.ubuntu上安装chrome # Install Google Chrome# https://askubuntu.com/questions/79280/how-to-install-chrome-browser-properly-via-command-linesudo apt-get install libxss1 libappindicator1 libindicator7wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.debsudo dpkg -i google-chrome*.deb # Might show "errors", fixed by next linesudo apt-get install -f 这时应该已经安装好了,用下边的命行运行测试一下: google-chrome --headless --remote-debugging-port=9222 https://chromium.org --disable-gpu
这里是使用headless模式进行远程调试,ubuntu上大多没有gpu,所以 下载地址: Nginx+FastDFS搭建图片服务器的方法实现 几步命令轻松搭建Windows SSH服务端 |