I am trying to click the log in button from https://search.connectourkids.org
driver = webdriver.Chrome("/Users/nicknavarro/Documents/DVS/chromedriver")
url = 'https://search.connectourkids.org'
driver.get(url)
print ("Opened Website")
sleep(30)
login = driver.find_element_by_css_selector("body > app-root > div > router-outlet > div > app-home > div > div > div > app-header > div > div > div > div > a.button ").click()
but I keep getting this error:
NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":"body > app-root > div > router-outlet > div > app-home > div > div > div > app-header > div > div > div > div > a.button "}
(Session info: chrome=107.0.5304.87)
I am expecting to log in, input a password and username and search for names.
CodePudding user response:
I could able to access the website through VPN only, so I didn't run this script, but it should work, try with these locators, all are XPaths:
For 'Log In' link the main page:
//a[contains(text(),'Log In')]
For email or username field:
//input[@type='email']
For password field:
//input[@type='password']
For Log In button:
//button[@class='auth0-lock-submit']
CodePudding user response:
if you are sure that the element exists on the page and you are sing the right selector to access it, then its posible that you are trying to access the element when it has not been created. Checkout this answer for help https://stackoverflow.com/a/74227905/7327747