Answer the question
In order to leave comments, you need to log in
Selenium can't find element?
Good day to all!
There is an input in which you need to enter data, but I get the following error:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="loginForm"]"}
<input aria-label="Номер телефона, имя пользователя или эл. адрес" aria-required="true" autocapitalize="off" autocorrect="off" maxlength="75" name="username" type="text" class="_2hvTZ pexuQ zyHYP" value="">
from selenium import webdriver
# init webdriver
driver = webdriver.Chrome('chromedriver')
# connect to instagram
driver.get('https://www.instagram.com/accounts/login/')
# find and select login form
login_form = driver.find_element_by_id('loginForm')
driver.switch_to.frame(login_form)
# input login
driver.find_element_by_name('username').send_keys('abcd')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question