insure no exception (if failed, return 0) and change 'load' to 'networkidle'

This commit is contained in:
Jason Lee
2024-02-26 22:07:08 +08:00
parent 889c22975e
commit 0edbcf404d
5 changed files with 47 additions and 14 deletions

View File

@@ -165,7 +165,10 @@ def get_rule_relativeTime(env, config: R) -> R:
next_day = 11
to_absoluteDay = datetime(next_year, next_month, next_day)
elif to_time == "next Friday":
to_absoluteDay = now + timedelta(days=((4-now.weekday()) if now.weekday() < 4 else (6-now.weekday()) + 5))
if now.weekday() < 4 and from_time in ["next Monday"]:
to_absoluteDay = now + timedelta(days=((4-now.weekday())+7))
else:
to_absoluteDay = now + timedelta(days=((4-now.weekday()) if now.weekday() < 4 else (6-now.weekday()) + 5))
else:
pass # more rules here
regular_to_time = apply_rules_to_timeFormat(relativeRules["expected"]["to"], to_absoluteDay)