selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element:

前端 未结 7 2274
长发绾君心
长发绾君心 2020-12-02 14:00

I\'m trying to automatically generate lots of users on the webpage kahoot.it using selenium to make them appear in front of the class, however, I get this error message when

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-02 14:27

    Looks like it takes time to load the webpage, and hence the detection of webelement wasn't happening. You can either use @shri's code above or just add these two statements just below the code driver = webdriver.Firefox():

    driver.maximize_window() //For maximizing window
    driver.implicitly_wait(20) //gives an implicit wait for 20 seconds
    

提交回复
热议问题