我試圖製作一個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的幀,然後發送鍵 –