I am using Selenium library for python to automate logging into turo.com. I can bring up the login screen, but the input fields for username/password and the login button are inside an iframe. I am able to switch to the iframe, however, I get the "Unable to locate element" error when it comes to targeting the input fields inside the iframe. Yes, I have tried using the WebDriverWait and EC conditions.
This is my current code, the code breaks because of the 8th line and gives me error saying there is no such element:
dropdown_menu = driver.find_element("xpath", '//button[@aria-label="open menu"]')
dropdown_menu.click()
time.sleep(1)
login_button = driver.find_element("xpath", '//a[@href="/us/en/login"]')
login_button.click()
time.sleep(4)
driver.switch_to.frame(0)
email_input = driver.find_element(By.XPATH, '//input[@id='email']')
email_input.click()
I have attached a photo of what the DOM looks like to this question: DOM