Title says it all. I'm using webdriver on a remote webserver without a GUI. From the command line, I can do this and everything works fine:
from selenium import webdriver
from pyvirtualdisplay import Display
display = Display(visible=0, size=(800,600))
display.start()
browser = webdriver.Firefox()
I.e., I can navigate the web, get urls, get source code, and everything else with the browser instance. But trying to execute a script on the server containing the same lines doesn't work. It might be relevant that the script is executed via PHP. Everything in the script works up until browser = webdriver.Firefox()
- that is, the imports and display stuff all work fine. It's just that last line; for some reason, the browser doesn't want to open when a script tries to do it. This makes no sense and I'm really stumped. Possible reasons/fixes? Maybe something to do with permissions?
EDIT
Just to clarify, I'm doing this all on the remote server. By command line I'm using SSH with PUTTY, and when I try testing the script, I simply do it on the website.