出现上述bug: 原因: 没有切换frame解决方法: frame = driver.find_element(By.CSS_SELECTOR,'iframe[id="login_frame"]') driver.swich_to.frame(frame)