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

前端 未结 7 2250
长发绾君心
长发绾君心 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

    It seems that your browser did not read proper HTML texts/tags, use a delay function that'll help the page to load first and then get all tags from the page.

    driver = webdriver.Chrome('./chromedriver.exe')
    # load the page
    driver.get('https://www.instagram.com/accounts/login/')
    # use delay function to get all tags
    driver.implicitly_wait(20)
    # access tag
    driver.find_element_by_name('username').send_keys(self.username)
    
    0 讨论(0)
提交回复
热议问题