can read email and click on the link

This commit is contained in:
2022-08-01 21:11:45 +02:00
parent f890454e25
commit 0b203b00ee
17 changed files with 355 additions and 43 deletions
+8 -8
View File
@@ -8,7 +8,7 @@ import xlsxwriter
from src.config import CONTACT_LIST_FILE
from src.db.mongo_manager import MONGO_STORE_MANAGER
from src.pojo.contact_pojo import ContactPojo
from src.pojo.mail_pojo import Mail
from src.pojo.mail.mail_pojo import MailAddress
from src.utils.generate_random_passport_id import get_random_passport_id_number
phone_number_prefix = ['6']
@@ -55,7 +55,7 @@ class ExcelHelper:
if contact_dict['mail']:
mail = contact_dict['mail'].strip()
pwd = contact_dict['password']
contact = Mail(mail, pwd)
contact = MailAddress(mail, pwd)
contact_list.append(contact)
return contact_list
@@ -124,7 +124,7 @@ def get_random_id_number() -> str:
return ran
def write_new_contacts_to_excel(valid_contacts: list):
def write_new_contacts_to_excel(valid_contacts: list, generate_passport = True):
row = 0
col = 0
# Create a workbook and add a worksheet.
@@ -151,9 +151,9 @@ def write_new_contacts_to_excel(valid_contacts: list):
if __name__ == '__main__':
excel_reader = ExcelHelper()
# contacts = excel_reader.read_names("/Users/lpan/Downloads/real_contacts.xlsx")
# print(contacts)
# write_new_contacts_to_excel(valid_contacts=contacts)
for mail in excel_reader.read_mails_and_pwd():
MONGO_STORE_MANAGER.insert_email(mail)
contacts = excel_reader.read_names("/Users/lpan/Downloads/real_contacts_31.xls")
print(contacts)
write_new_contacts_to_excel(valid_contacts=contacts)
# for mail in excel_reader.read_mails_and_pwd():
# MONGO_STORE_MANAGER.insert_email(mail)
Binary file not shown.