I'm trying to interact with a username and password html input object using selenium web driver python library. And while I can interact with most html tags the code I have will not work on a deeply nested 'input' tag to key in the username and password. See attached image for
I've tried using the xpath module by itself and i have also tried using WebDriverWait in case elements needed to load up before being able to access. When I've tried WebDriverWait the code never reaches the timeoutException it just freezes in the runtime terminal and I have to manually kill it.
chrome_options = Options()
#chrome_options.add_argument("--headless")
recollect_url = r"https://manage.recollect.net/admin"
driver = webdriver.Chrome("C:\Users\Jlong\Downloads\chromedriver_win32\chromedriver.exe",chrome_options=chrome_options)
driver.get(recollect_url)
pagesource = driver.page_source
try:
myElem = WebDriverWait(driver, 5).until(EC.presence_of_element_located((By.XPATH, "//input[@name='email']")))
myElem2 = WebDriverWait(driver, 5).until(EC.presence_of_element_located((By.CLASS_NAME, 'auth0-lock-input-block '
'auth0-lock-input-email')))
print "Page is ready!"
except TimeoutException:
print "Loading took too much time!"
I would expect to be able to use send_keys()
method for username and password and then use click method on submit to enter credentials