How do I run Selenium in Xvfb?

前端 未结 5 1836
面向向阳花
面向向阳花 2020-11-22 08:21

I\'m on EC2 instance. So there is no GUI.

$pip install selenium
$sudo apt-get install firefox xvfb

Then I do this:

$Xvfb :1         


        
5条回答
  •  情书的邮戳
    2020-11-22 09:20

    The easiest way is probably to use xvfb-run:

    DISPLAY=:1 xvfb-run java -jar selenium-server-standalone-2.0b3.jar
    

    xvfb-run does the whole X authority dance for you, give it a try!

提交回复
热议问题