我在 Windows 10 上使用 Python 3.8.3。我有以下代码:
import # all the necessary modules
try:
# do something
except WebDriverException:
print(sys.exc_info()[0])
在异常情况下,我收到以下信息:
<class 'selenium.common.exceptions.SessionNotCreatedException'>
我如何才能print()只输出内的字符串<class>?:
selenium.common.exceptions.SessionNotCreatedException
任何帮助,将不胜感激。
RISEBY
慕田峪9158850
相关分类