Getting an error using selenium webdriver. Have the following code -
# A very simple Flask Hello World app for you to get started with...
from pyvirtualdisplay import Display
from selenium import webdriver
from flask import Flask
import time
app = Flask(__name__)
@app.route('/')
def hello_world():
with Display():
# we can now start Firefox and it will run inside the virtual display
browser = webdriver.Firefox()
# put the rest of our selenium code in a try/finally
# to make sure we always clean up at the end
try:
browser.get('http://www.google.com')
return 'worked'
finally:
browser.quit()
[edit by admin: formatting]