python - python selnium网站登录除了问题
问题描述
错误信息不打印是什么问题?ㅠㅠㅠㅠ
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))
解决方案
为了打印异常,您需要实际打印 e,而不是 uid:
.....
except Exception as e:
print("{} 계정 로그인이 실패하였습니다.".format(uid))
print(e)
推荐阅读
- mysql - MySQL 声明继续处理程序语法错误
- ruby - AWS Rekognition -- 如何解析图像中的所有文本?
- spring - 无法访问 spring-docs-open-ui 招摇文档
- python - 与 Python 异步从管道子进程获取流
- postgresql - 触发 PostgreSQL 根据其他三个值的总和更新一个值
- c# - ASP.Net Core 从外部 API 导入 JSON
- python - 将图像读取到元组数组的最快方法是什么?
- sql - SQL OLE 自动化授予对 Linux 共享的访问权限
- go - 处理零切片索引的更好方法
- javascript - Visual Studio 代码解析错误,无法修复