Hi, Beginner here, I am trying to run a daily report which requires logging into a webpage, so I am using selenium to get where I need to go, the script works locally but to get it onto PythonAnywhere I need to use pyvirtualdisplay. I have installed the version for python 3.4 but selenium is hitting the error below:
selenium.common.exceptions.NoSuchElementException: Message: 'Unable to locate element: {"method":"name","selector":"username"}'
As the program works locally I assume I am doing something incorrectly with pyvirtualdisplay, I have added in a fair number of wait_implicitlys and time.sleeps to allow plenty of space for the display to get up and running.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
from pyvirtualdisplay import Display
display = Display(visible=0, size=(1024, 768))
time.sleep(5)
display.start()
time.sleep(5)
driver = webdriver.Firefox()
driver.get('http://www.touchoffice.net/')
driver.implicitly_wait(30)
username = driver.find_element_by_name("username")
password = driver.find_element_by_name("password")
Any advice to get this working?