I am writing a simple program to automatically login to my Disney World account. I cannot successfully locate the email address element. I have had success automating other buttons on the Disney World website, but for whatever reason, I can't locate the email address element.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
login_url = "https://disneyworld.disney.go.com/login?appRedirect=%2F"
driver = webdriver.Chrome(executable_path=r"MY_CHROMEDRIVER_PATH")
driver.get(login_url)
print("Starting...")
try:
email_input = WebDriverWait(driver, 8).until(
EC.presence_of_element_located((By.XPATH, "")) #See below what I've tried on this line
)
print("Found element, sending keys...")
email_input.send_keys("test")
except:
print("Failed...")
driver.quit()
I have tried the following with no success:
EC.presence_of_element_located((By.XPATH, "//input\[@type='email'\]"))
EC.presence_of_element_located((By.XPATH, "//div\[@id='did-ui-view'\]/div/section/section/form/section/div/div/label/span\[2\]/input"))
EC.presence_of_element_located((By.CSS_SELECTOR, ".ng-valid"))
EC.presence_of_element_located((By.CLASS_NAME, "input-wrapper"))
EC.presence_of_element_located((By.CLASS_NAME, "field-group"))
EC.presence_of_element_located((By.CLASS_NAME, "field field-username-email badgeable"))
I have also tried many other versions of the examples above far too embarrassing to post on here. I have used the inspect element tool and tried everything I could think of. I also downloaded the Selenium IDE Chrome extension to record my keystrokes and find the exact XPATH for the element I was interacting with. I honestly don't know what else to try, which is why I'm posting this question. Any help would be appreciated.
