added verification de URL not valide

This commit is contained in:
2022-07-29 22:30:49 +02:00
parent 01cf4211fc
commit f890454e25
5 changed files with 73 additions and 6 deletions
+7 -3
View File
@@ -23,6 +23,7 @@ SORRY_SENTENCE_FR = "nous sommes sincèrement désolés de n'avoir pu vous satis
SORRY_SENTENCE_EN = "we are extremely sorry that we were not able to fulfill"
NOT_AVAILABLE_CONTENT = "For more than 130 years, our House has offered its full expertise to satisfy"
PENDING_SENTENCE = "Ce soir, entre 20:00 et 20:30, vous obtiendrez une réponse par e-mail."
URL_TO_VALID_SENTENCE = "Nous avons envoyé un lien par e-mail."
PENDING_SENTENCE_EN = "This evening between 20:00 and 20:30 you will receive a response by email."
# URLs to ignore during checking results
BLANK_URL = "about:blank"
@@ -80,6 +81,9 @@ class ResultChecker:
elif PENDING_SENTENCE in content:
print("status is PENDING")
status = ResultEnum.PENDING
elif URL_TO_VALID_SENTENCE in content:
print("status is REFUSED")
status = ResultEnum.REFUSED
elif PENDING_SENTENCE_EN in content:
print("status is PENDING")
status = ResultEnum.PENDING
@@ -108,10 +112,10 @@ def check_results(headless=False):
reserve_list = MONGO_STORE_MANAGER.get_all_successful_items_for_day()
print("size is " + str(len(reserve_list)))
start_check(reserve_list, firestore_collection, headless, need_send_email=False)
reserve_list = MONGO_STORE_MANAGER.get_all_successful_items_for_day()
start_check(reserve_list, firestore_collection, headless, need_send_email=True)
# reserve_list = MONGO_STORE_MANAGER.get_all_successful_items_for_day()
# start_check(reserve_list, firestore_collection, headless, need_send_email=True)
# copy the accepted info to the accepted collection
migre_accepted_appointment(str(datetime.date.today()))
# migre_accepted_appointment(str(datetime.date.today()))
def start_check(reserve_list, firestore_collection, headless: bool, need_send_email: bool):