starting headless firefox with Xvfb does not work

早过忘川 提交于 2019-12-08 09:23:27

问题


I try to run firefox in headless mode for selenium.

$xvfb-run firefox seems to work.

I run firefox through selenium so i cannot run xvfb-run directly.

So i start

Xvfb :1 -screen 0 1024x768x24 &

and then

set DISPLAY:=1 env DISPLAY:=1

Still when i run firefox i get

Error: no display specified

I run on centos 6 and firefox 38 ESR.

What can be done?


回答1:


can you try that? export DISPLAY=:1




回答2:


start firefox with --display arg

/usr/bin/firefox --display=:1


来源:https://stackoverflow.com/questions/32480000/starting-headless-firefox-with-xvfb-does-not-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!