我试图制作一个Python程序,它将自动登录到我学校的网站。Python Selenium无法找到元素
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="loginidtext"]"}
相关的代码段引发错误是::
BCnumber = driver.find_element_by_xpath('//*[@id="loginidtext"]')
BCnumber.send_keys('loginid')
的网址是: https://matrix.tjc.edu.sg/?topleft=toprow.php&bottomright=bottomrow.php
我已经尝试使用:不过,我有一个错误返回
driver.switch_to
切换到相关的div,但同样的错误是返回...
that loginidtext field in inside the second frame。因此,我们需要切换到索引为1的帧,然后发送键 –