· 7 years ago · Oct 29, 2018, 11:02 PM
1
2domains = [ "hotmail.com", "gmail.com", "aol.com", "mail.com" , "mail.kz", "yahoo.com"]
3numbers= ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
4
5def get_random_domain(domains):
6 return random.choice(domains)
7
8def get_random_numbers(length):
9 return ''.join(random.choice(numbers) for i in range(length))
10
11def generate_random_email(length):
12 return 'johnharrison' + get_random_numbers(3) + '@' + get_random_domain(domains)
13
14------------------------------------------------------------------------------------------------
15
16emailBox = driver.find_element_by_xpath('//*[@name="emailAddress"]')
17emailBox.send_keys(generate_random_email(1))
18
19----------------------------------------------------------------------------------
20
21
22with open("doc.txt", "a") as document:
23 document.write()