-3

错误信息不打印是什么问题?ㅠㅠㅠㅠ

 uid = id
 upw = pw

try:  
            driver.find_element_by_xpath('//*[@id="userID"]').send_keys(uid)  
            action.reset_actions()
            driver.find_element_by_xpath('//*[@id="userPWD"]').send_keys(upw) 
            driver.find_element_by_xpath('//*[@id="btnLogin"]').click() 
        except Exception as e: 
                print("{} 계정 로그인이 실패하였습니다.".format(uid))
4

1 回答 1

0

为了打印异常,您需要实际打印 e,而不是 uid:

.....
except Exception as e: 
    print("{} 계정 로그인이 실패하였습니다.".format(uid))
    print(e)
于 2021-04-06T17:13:20.507 回答