From 91353257089ec9f784f9f090e70e9fb17138d670 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 4 Sep 2022 11:21:10 +0200 Subject: [PATCH] Refrain from polling at the weekend --- main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.py b/main.py index 46f4b67..9639142 100755 --- a/main.py +++ b/main.py @@ -1,4 +1,5 @@ import base64 +from datetime import datetime import json import os import threading @@ -23,6 +24,13 @@ def check_exists_by_xpath(self, xpath): class Bot: def __init__(self): + dt = datetime.now() + + # saturday, sunday + if dt.isoweekday() == 6 or dt.isoweekday() == 7: + print("No request required today") + return + options = webdriver.ChromeOptions() if os.environ.get("browserDebug") == "false":