Running selenium with firefox without display

Is there a way to run a selenium python script that involves accessing a webpage using firefox but without displaying? I run this on ubuntu VPS and I do not have access to the display unless I install ubuntu-desktop with VNC, which takes up a lot of memory.

So, is there a solution to run firefox without displaying on the ubuntu server?

Thanks in advance.

+8
linux firefox selenium
source share
1 answer

Try connecting via ssh using the -X switch. This will allow you to remotely use X applications. It will be a little slow, but it should be used for many applications.

ssh -X you@yourserver $ firefox & 

Edit: I just checked this on one of my ubuntu servers. It took ~ 140 MB of additional depots to install firefox (without ubuntu-desktop or xserver).

+2
source share

All Articles