add new condifition to refresh page.
parent
28c00c4ca3
commit
cbc80965b6
|
@ -44,7 +44,7 @@ warnings.simplefilter('ignore',InsecureRequestWarning)
|
||||||
#附註1:沒有寫的很好,很多地方應該可以模組化。
|
#附註1:沒有寫的很好,很多地方應該可以模組化。
|
||||||
#附註2:
|
#附註2:
|
||||||
|
|
||||||
CONST_APP_VERSION = u"MaxBot (2021.03.21)"
|
CONST_APP_VERSION = u"MaxBot (2021.03.22)"
|
||||||
|
|
||||||
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"
|
||||||
|
@ -805,12 +805,16 @@ def date_auto_select(url):
|
||||||
#print("find .btn-next fail:", exc)
|
#print("find .btn-next fail:", exc)
|
||||||
|
|
||||||
# PURPOSE: get target area list.
|
# PURPOSE: get target area list.
|
||||||
|
# RETURN:
|
||||||
|
# is_need_refresh
|
||||||
|
# areas
|
||||||
def get_tixcraft_target_area(el, area_keyword):
|
def get_tixcraft_target_area(el, area_keyword):
|
||||||
areas = None
|
|
||||||
is_need_refresh = False
|
is_need_refresh = False
|
||||||
|
areas = None
|
||||||
|
|
||||||
if el is not None:
|
|
||||||
area_list = None
|
area_list = None
|
||||||
|
area_list_count = 0
|
||||||
|
if el is not None:
|
||||||
try:
|
try:
|
||||||
area_list = el.find_elements(By.TAG_NAME, 'a')
|
area_list = el.find_elements(By.TAG_NAME, 'a')
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
|
@ -818,14 +822,15 @@ def get_tixcraft_target_area(el, area_keyword):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if area_list is not None:
|
if area_list is not None:
|
||||||
if len(area_list) == 0:
|
area_list_count = len(area_list)
|
||||||
|
if area_list_count == 0:
|
||||||
print("(with keyword) list is empty, do refresh!")
|
print("(with keyword) list is empty, do refresh!")
|
||||||
is_need_refresh = True
|
is_need_refresh = True
|
||||||
else:
|
else:
|
||||||
print("(with keyword) list is None, do refresh!")
|
print("(with keyword) list is None, do refresh!")
|
||||||
is_need_refresh = True
|
is_need_refresh = True
|
||||||
|
|
||||||
if area_list is not None:
|
if area_list_count > 0:
|
||||||
areas = []
|
areas = []
|
||||||
for row in area_list:
|
for row in area_list:
|
||||||
row_is_enabled=False
|
row_is_enabled=False
|
||||||
|
@ -881,8 +886,10 @@ def get_tixcraft_target_area(el, area_keyword):
|
||||||
break
|
break
|
||||||
#print("row_text:" + row_text)
|
#print("row_text:" + row_text)
|
||||||
#print("match:" + area_keyword)
|
#print("match:" + area_keyword)
|
||||||
|
|
||||||
if len(areas) == 0:
|
if len(areas) == 0:
|
||||||
areas = None
|
areas = None
|
||||||
|
is_need_refresh = True
|
||||||
|
|
||||||
return is_need_refresh, areas
|
return is_need_refresh, areas
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import json
|
import json
|
||||||
|
|
||||||
CONST_APP_VERSION = u"MaxBot (2021.03.21)"
|
CONST_APP_VERSION = u"MaxBot (2021.03.22)"
|
||||||
|
|
||||||
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"
|
||||||
|
|
Loading…
Reference in New Issue