【发布时间】:2020-11-15 11:31:02
【问题描述】:
我正在运行 Python Selenium 脚本,有时,当互联网连接不工作时,我会遇到两种类型的错误:
timeout: Timed out receiving message from renderer: 300.000
unknown error: net::ERR_PROXY_CONNECTION_FAILED
所以我想做这个;每次出现这 2 个错误中的一个时,运行我笔记本电脑上的另一个脚本
这是我的代码的相关部分:
except Exception as e:
print(e)
line_count += 1
if "Timed out" in e:
os.system(r"C:\Users\SAMSUNG\script.py")
print("Done")
pass
else:
print("Not Concerned Error")
pass
if "ERR_PROXY" in e:
os.system(r"C:\Users\SAMSUNG\script.py")
print("Done")
pass
else:
print("Not Concerned Error")
pass
但它不起作用!这是我的错误:
if "Timed out" in e:
TypeError: argument of type 'TimeoutException' is not iterable
【问题讨论】:
-
我想你会找到答案的here
标签: python python-3.x selenium timeout