Hi Conrad,
Thanks so much for replying!
I actually saw that post and I tried what was described in it to no avail.
As I am using Python 3.3, I also created a virtualenv so that I could install and import pyvirtualdisplay.
However, I am now getting the error message I have included below.
I have a web app that I am almost ready to deploy and I would be ready to sign up as a paid user the moment I can get this resolved. However, I really need Selenium to work for my web app to work, so this has been quite frustrating. Thanks so much for trying to help though :)
My code is now as follows:
#A very simple Bottle Hello World app for you to get started with...
from bottle import default_app, route
from pyvirtualdisplay import Display
from selenium import webdriver
import time
display = Display(visible=0, size=(800, 600))
display.start()
@route('/')
def hello_world():
return 'Hello from Bottle!'
@route('/test')
def test():
browser = webdriver.Firefox()
browser.get('http://www.google.com')
return browser.title
application = default_app()
This is the error message that I retrieved from the error log:
2016-08-30 17:07:36,192 :Error running WSGI application
Traceback (most recent call last):
File "/bin/user_wsgi_wrapper.py", line 154, in __call__
app_iterator = self.app(environ, start_response)
File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application
raise e
File "/bin/user_wsgi_wrapper.py", line 154, in __call__
app_iterator = self.app(environ, start_response)
File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application
raise e
File "/bin/user_wsgi_wrapper.py", line 154, in __call__
app_iterator = self.app(environ, start_response)
File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application
raise e
File "/bin/user_wsgi_wrapper.py", line 154, in __call__
app_iterator = self.app(environ, start_response)
File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application
raise e
File "/bin/user_wsgi_wrapper.py", line 154, in __call__
app_iterator = self.app(environ, start_response)
File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application
raise e
File "/bin/user_wsgi_wrapper.py", line 154, in __call__
app_iterator = self.app(environ, start_response)
File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application
raise e
File "/bin/user_wsgi_wrapper.py", line 154, in __call__
app_iterator = self.app(environ, start_response)
File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application
raise e
File "/bin/user_wsgi_wrapper.py", line 179, in <module>
application = load_wsgi_application()
File "/bin/user_wsgi_wrapper.py", line 175, in load_wsgi_application
return __import__(os.environ['WSGI_MODULE'], globals(), locals(), ['application']).application
File "/var/www/mforcexxii_pythonanywhere_com_wsgi.py", line 22, in <module>
from bottle_app import application
File "/home/mforcexxii/mysite/bottle_app.py", line 8, in <module>
browser = webdriver.Firefox()
File "/home/mforcexxii/.virtualenvs/myvirtualenv/lib/python3.3/site-packages/selenium/webdriver/firefox/webdriver.py", line 80, in __init__
self.binary, timeout)
File "/home/mforcexxii/.virtualenvs/myvirtualenv/lib/python3.3/site-packages/selenium/webdriver/firefox/extension_connection.py", line 52, in __init__
self.binary.launch_browser(self.profile, timeout=timeout)
File "/home/mforcexxii/.virtualenvs/myvirtualenv/lib/python3.3/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
self._wait_until_connectable(timeout=timeout)
File "/home/mforcexxii/.virtualenvs/myvirtualenv/lib/python3.3/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 99, in _wait_until_connectable
"The browser appears to have exited "
selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.