log to file

This commit is contained in:
2024-03-21 11:25:01 +01:00
parent 40c7c7cf96
commit 67b6a181cb
2 changed files with 25 additions and 6 deletions
+6 -1
View File
@@ -68,7 +68,8 @@ class Sender:
'surname': contact.last_name.capitalize(), 'name': contact.first_name.capitalize(),
'phone_country': "FR", 'phone_number': "+33 " + contact.phone, 'email': contact.mail,
'passport_id': contact.passport, 'processing': 'on', 'cgu': 'on'}
print(data)
self.logger.info(data)
self.logger.info("try to request for mail:{}".format(contact.mail))
print("send request with cookie:{}".format(self.cookie_str))
try:
proxy_to_use = self.proxy_to_use
@@ -96,6 +97,10 @@ class Sender:
return RequestResult.SUCCESS
else:
print(response.text)
if response.status_code == 403:
# try to load seesion
# session = HTMLSession()
return RequestResult.BLOCKED
return RequestResult.BLOCKED
except Exception as Error:
print(Error)