Skip to content

Commit

Permalink
fix(huawei): 最后抢购环节优化
Browse files Browse the repository at this point in the history
  • Loading branch information
ancoka committed Oct 22, 2023
1 parent bb66576 commit d03b5f1
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions huawei.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,10 @@ def __start_buying(self):
if countdownMsDiff > 1000:
logger.info("距离抢购活动最后下单环节开始还剩:{}", utils.format_countdown_time(countdown_times))
time.sleep(1)
elif countdownMsDiff > 100:
logger.info("距离抢购活动最后下单环节开始还剩:{}", utils.format_countdown_time(countdown_times))
time.sleep(0.1)
elif countdownMsDiff > -10000:
else:
logger.info("抢购活动最后下单环节,开始抢购中")
logger.info("距离抢购活动最后下单环节开始还剩:{}", utils.format_countdown_time(countdown_times))
self.__check_box_ct_pop_stage()
try:
order_btn = self.__find_element_text(By.CSS_SELECTOR, "#pro-operation > span", "立即下单")
if order_btn is not None:
Expand All @@ -232,11 +231,8 @@ def __start_buying(self):
click_times += 1
logger.info("抢购活动最后下单环节,已尝试点击立即下单 {} 次", click_times)

self.__check_box_ct_pop_stage()
self.__submit_order("__start_buying")
time.sleep(0.001)
else:
self.isStartBuying = False
logger.info("抢购活动最后下单环节结束")

def __check_box_ct_pop_exists(self):
Expand Down

0 comments on commit d03b5f1

Please sign in to comment.