home0928
This commit is contained in:
+8
-6
@@ -163,21 +163,23 @@ def save_param4(param4_value):
|
||||
# 主处理函数
|
||||
def main():
|
||||
logger.info("查询处理代码启动")
|
||||
ewcc = Sinopec_ewcc()
|
||||
ewcc = Sinopec_ewcc()
|
||||
i =0
|
||||
# 主循环
|
||||
while True:
|
||||
|
||||
try:
|
||||
# 获取参数配置
|
||||
parameters = get_parameters()
|
||||
if not parameters:
|
||||
logger.warning("无法获取参数配置,停止30秒后继续")
|
||||
time.sleep(30)
|
||||
logger.warning("无法获取配置参数,停止5秒后继续")
|
||||
time.sleep(5)
|
||||
continue
|
||||
|
||||
# 判断当前连接状态,重新连接
|
||||
if not ewcc.browser.states.is_alive:
|
||||
ewcc.browser.reconnect()
|
||||
logger.info("浏览器连接已断开,尝试重新连接")
|
||||
ewcc.quit( )
|
||||
ewcc=Sinopec_ewcc()
|
||||
continue
|
||||
|
||||
# 自动登录
|
||||
if not ewcc.Autologin(parameters['param1'],parameters['param2'],parameters['param3'],parameters['param4']):
|
||||
|
||||
Reference in New Issue
Block a user