Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Commit d601ff2

Browse files
committed
fixed a bug in punchcard
1 parent 6826dc2 commit d601ff2

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

helper/browser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,7 @@ def click_by_xpath(self, xpath) -> bool:
258258
except WebDriverException:
259259
logging.exception(
260260
msg=f'Webdriver Error for click by xpath to {xpath} object')
261-
finally:
262-
return False
261+
return False
263262

264263
def clear_by_id(self, obj_id) -> bool:
265264
"""

ms_rewards.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ def get_login_info():
107107
msr.work(flag_pc=parser.pc_mode, flag_mob=parser.mobile_mode,
108108
flag_quiz=parser.quiz_mode)
109109

110-
except WebDriverException:
111-
logging.exception(msg='Failure at main()')
110+
except Exception:
111+
logging.exception('An error has occurred.', exc_info=True)
112112
finally:
113113
logging.info(msg='--------------------------------------------------')
114114
logging.info(msg='-----------------------End------------------------')

msreward/worker/dashboard/punchcard.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ def _click_through_punch_card(self, max_attempts=5):
3232
for _ in range(max_attempts):
3333
try:
3434
if not self._browser.click_by_xpath('//a[@class= "offer-cta"]/child::button[contains(@class, "btn-primary")]'):
35-
self._browser.close()
36-
self._browser.goto_latest_window()
3735
break
38-
time.sleep(4)
36+
time.sleep(1)
3937
self._browser.goto_latest_window()
4038
self._browser.close()
4139
self._browser.goto_latest_window()

0 commit comments

Comments
 (0)