Potem Potem
Potem Potem

Reputation: 123

using selenium from pythonanywhere?

I want use selenium in pythonanywhere. this is error log in pythonanywhere.

Traceback (most recent call last):
  File "/bin/user_wsgi_wrapper.py", line 154, in __call__
    app_iterator = self.app(environ, start_response)
  File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 2000, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1991, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1567, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1988, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1641, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1544, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1639, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1625, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/downtownhub/odermysite/minitwit.py", line 409, in ordercolect
    driver = webdriver.Firefox()
  File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/selenium/webdriver/firefox/webdriver.py", line 135, in __init__
    self.service.start()
  File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/selenium/webdriver/common/service.py", line 71, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 

So I added geckodrive file in Path('/home/downtownhub/odermysite/env/bin'). but it happen same error. what can I solve it??

Upvotes: 1

Views: 563

Answers (1)

hwjp
hwjp

Reputation: 16091

Ah, I see you're using a virtualenv. PythonAnywhere uses an old version of Firefox (v17) which is not compatible with the latest selenium/geckodriver. Switch back to selenium 2:

./env/bin/pip install "selenium<3"

Upvotes: 3

Related Questions