add retry for kktix checkbox

master
Max Yao 2020-01-14 22:09:57 +08:00
parent 6d40d70a95
commit a783c28b02
2 changed files with 16 additions and 10 deletions

View File

@ -44,7 +44,7 @@ warnings.simplefilter('ignore',InsecureRequestWarning)
#附註1沒有寫的很好很多地方應該可以模組化。 #附註1沒有寫的很好很多地方應該可以模組化。
#附註2 #附註2
CONST_APP_VERSION = u"MaxBot (2020.01.12)" CONST_APP_VERSION = u"MaxBot (2020.01.13)"
CONST_FROM_TOP_TO_BOTTOM = u"from top to bottom" CONST_FROM_TOP_TO_BOTTOM = u"from top to bottom"
CONST_FROM_BOTTOM_TO_TOP = u"from bottom to top" CONST_FROM_BOTTOM_TO_TOP = u"from bottom to top"
@ -1905,23 +1905,29 @@ def kktix_reg_new_main(url, answer_index, registrationsNewApp_div, is_finish_che
# must ensure checkbox has been checked. # must ensure checkbox has been checked.
if not is_finish_checkbox_click: if not is_finish_checkbox_click:
# retry again. for retry_i in range(10):
is_need_refresh, is_finish_checkbox_click = kktix_check_agree_checkbox() # retry again.
is_need_refresh, is_finish_checkbox_click = kktix_check_agree_checkbox()
if not is_finish_checkbox_click: time.sleep(0.1)
# retry again. if is_finish_checkbox_click:
is_need_refresh, is_finish_checkbox_click = kktix_check_agree_checkbox() break
if not is_captcha_appear: if not is_captcha_appear:
# without captcha. # without captcha.
# normal mode. # normal mode.
#print("# normal mode.") #print("# normal mode.")
kktix_press_next_button() if is_finish_checkbox_click:
kktix_press_next_button()
else:
print("unable to assign checkbox value")
else: else:
if is_captcha_appear_and_filled_password: if is_captcha_appear_and_filled_password:
# for easy guest mode, we can fill the password correct. # for easy guest mode, we can fill the password correct.
#print("for easy guest mode, we can fill the password correct.") #print("for easy guest mode, we can fill the password correct.")
kktix_press_next_button() if is_finish_checkbox_click:
kktix_press_next_button()
else:
print("unable to assign checkbox value")
else: else:
# not is easy guest mode. # not is easy guest mode.
#print("# not is easy guest mode.") #print("# not is easy guest mode.")

View File

@ -16,7 +16,7 @@ import os
import sys import sys
import json import json
CONST_APP_VERSION = u"MaxBot (2020.01.12)" CONST_APP_VERSION = u"MaxBot (2020.01.13)"
CONST_FROM_TOP_TO_BOTTOM = u"from top to bottom" CONST_FROM_TOP_TO_BOTTOM = u"from top to bottom"
CONST_FROM_BOTTOM_TO_TOP = u"from bottom to top" CONST_FROM_BOTTOM_TO_TOP = u"from bottom to top"