I am trying to enter username and password in the following website: https://www.thegreatcoursesplus.com/sign-in
driver = webdriver.Chrome()
driver.get(\'htt
There are two problems:
tag, not
tag, and there are many fields that matches this xpath. I suggest you locate the form holding the fields and use it to locate each fieldFor the timing issue you can use explicit wait
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome()
driver.get('https://www.TheGreatCoursesPlus.com/sign-in')
form = WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, '//div[@class="modal-body"]//form')))
form.find_element_by_name('email').send_keys(email)
form.find_element_by_name('password').send_keys(password)
form.find_element_by_name('sign-in-button').click()