我正在尝试为我的 Ubuntu 服务器设置 headless firefox 浏览器。我按照其他帖子的说明进行操作,但似乎没有任何效果。尝试启动 firefox 时出现此错误。
~(branch:master*) » firefox jake@ubuntu
Error: no display specified
------------------------------------------------------------
~(branch:master*) » phpunit functional/SiteTest.php jake@ubuntu
------------------------------------------------------------
~(branch:master*) » export DISPLAY=:10 jake@ubuntu
------------------------------------------------------------
~(branch:master*) » firefox jake@ubuntu
Error: cannot open display: :10
我想这一定是显示驱动程序的问题。
这些是我遵循的说明。
http://www.installationpage.com/selenium/how-to-run-selenium-headless-firefox-in-ubuntu/
如果您需要更多详细信息,请告诉我。
最佳答案
安装xvfb
包:
sudo apt-get install xvfb
然后像这样运行 firefox:
xvfb-run firefox
关于linux - 如何设置 headless firefox 浏览器 Ubuntu 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17395320/