Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running selenium with firefox without a display

Is there any way to run a selenium python script that's supposed access a webpage using firefox but without a display? I am running this on an ubuntu VPS and I have no way of accessing a display unless I install ubuntu-desktop with VNC which takes up a LOT of memory.

So is there a solution to running firefox without a display on an ubuntu server?

Thanks in advance.

like image 826
TheNotSoWise Avatar asked Feb 23 '12 03:02

TheNotSoWise


1 Answers

Try connecting via ssh with the -X switch. That will enable you to use X applications remotely. It will be a little slow but it should be usable for a lot of applications.

ssh -X you@yourserver
$ firefox &

Edit: I just checked it out on one of my ubuntu servers. It required ~140MB of extra deps to install firefox (no ubuntu-desktop, or xserver).

like image 63
dubvfan87 Avatar answered Nov 11 '22 22:11

dubvfan87