use brightdata proxy
This commit is contained in:
@@ -54,6 +54,8 @@ class ExcelHelper:
|
||||
name = raw_name.split(' ')
|
||||
if len(name) == 1:
|
||||
name = raw_name.split('\xa0')
|
||||
if len(name) == 1:
|
||||
print("error in " + str(name))
|
||||
last_name = name[0]
|
||||
if len(name) == 2:
|
||||
first_name = name[-1]
|
||||
@@ -85,10 +87,14 @@ def get_random_phone_numbers():
|
||||
|
||||
|
||||
def generate_email_from_name(first_name: str, last_name: str) -> str:
|
||||
length = 4 # number of characters in the string.
|
||||
length = 2 # number of characters in the string.
|
||||
ran = ''.join(random.choices(string.digits, k=length))
|
||||
separator = ['.', '_', '']
|
||||
email = "{}{}{}{}@163.com".format(last_name.lower(), random.choice(separator), first_name.lower(), ran)
|
||||
domains = ['gmail.com', 'hotmail.com', 'yahoo.com', 'aol.com', 'outlook.com', 'hotmail.fr', 'gmx.com',
|
||||
'hotmail.com', 'yahoo.com', 'aol.com', 'hotmail.com']
|
||||
email = "{}{}{}{}@{}".format(last_name.lower(), random.choice(separator),
|
||||
first_name.replace("-", "").replace("'", "").lower(), ran,
|
||||
random.choice(domains))
|
||||
print(email)
|
||||
return email
|
||||
|
||||
@@ -129,6 +135,6 @@ def write_new_contacts_to_excel(valid_contacts: list):
|
||||
|
||||
if __name__ == '__main__':
|
||||
excel_reader = ExcelHelper()
|
||||
contacts = excel_reader.read_names("C:/Users/landd/Desktop/1000.xlsx")
|
||||
contacts = excel_reader.read_names("C:/Users/landd/Downloads/names.xlsx")
|
||||
print(contacts)
|
||||
write_new_contacts_to_excel(valid_contacts=contacts)
|
||||
|
||||
Reference in New Issue
Block a user