Code: Select all
selenium.common.exceptions.NoSuchElementException: Message: no such element:
Unable to locate element: {"method":"css selector","selector":"[id="sign-in-email-input"]"}
Code: Select all
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
def get_driver():
#set options to make browsing easier
options = webdriver.ChromeOptions()
options.add_experimental_option("detach", True)
options.add_argument("disable-infobars")
options.add_argument("start-maximized")
options.add_argument("disable-dev-shm-usag")
options.add_argument("no-sandbox")
options.add_experimental_option("escludeSwitches", ["enable-automation"])
options.add_argument("disable-blink-features=AutomationControlled")
driver = webdriver.Chrome()
driver.get("https://auth.hbomax.com/login")
return driver
def main():
driver = get_driver()
wait = WebDriverWait(driver, 10)
#accepts cookie
wait.until(EC.presence_of_element_located((By.XPATH, "/html/body/div[1]/div[1]/div/div/div/section/div/button[1]/div/div/span"))).click()
#unable to locate element
wait.until(EC.presence_of_all_elements_located((By.XPATH, "//*[@id='sign-in-email-input']")))
Code: Select all
By.ID, "sign-in-email-input"
by.ID, "sign-in-email"
by.XPATH, "//*[@id='sign-in-email']/div"
by.XPATH, "//*[@id='sign-in-email-input']"
by.XPATH, "/html/body/div[1]/div[2]/div[1]/div/main/div[2]/gi-login//gi-sign-in-flow/gi-sign-in-email//gi-track-analytics-events/div/gi-form/div/form/div[2]/div/gi-form-input/div/input"
Code: Select all
Endereço de e-mail
Mobile version