pythonseleniumselenium-webdriverframewebdriverwait

Selenium in Python: "NoSuchElementException: Message: no such element: Unable to locate element"


I tried typing 'abc' in the first block of id and 'cdef' in the second block of password.

However, the error code at the bottom comes up.

from selenium import webdriver
driver.get('http://sugang.korea.ac.kr')

I added an implicit wait to prevent the code from executing before the page fully loads.

driver.implicitly_wait(30)

Code for adding username and password is as below:

driver.find_element_by_name('id').send_keys('abc') driver.find_element_by_name('pw').send_keys('cdef')

But I am getting the below error:

NoSuchElementException: Message: no such element: Unable to locate element: {"method":"id","selector":"id"}


Solution

  • The username and password fields are within an frame, so you have to:

    sugang_korea_ac_kr