close browser when exception on validate email

This commit is contained in:
2022-11-06 10:59:02 +01:00
parent b93d40a42f
commit c1f4ee7b6d
2 changed files with 6 additions and 5 deletions
+3 -1
View File
@@ -10,6 +10,7 @@ from builtins import list
from src import params
from src.db.mongo_manager import MONGO_STORE_MANAGER
from src.logs.AppLogging import init_logger
from src.pojo.mail.mail_pojo import MailPojo, MailAddress
from src.proxy.proxy_type import ProxyType
from src.utils.timeutiles import is_time_between
@@ -198,11 +199,12 @@ def read_mails():
if need_to_valid_url(url, successful_items):
url_validator = LinkValidator(url)
print("need to validate url: " + url)
executor.submit(url_validator.start_page, params.get_proxy(ProxyType.OXYLABS), True)
executor.submit(url_validator.start_page, params.get_proxy(ProxyType.OXYLABS), False)
else:
print("do not need to click url --> {}".format(mail.mail_address))
# check whether the url has already been clicked
if __name__ == '__main__':
init_logger()
read_mails()