как сделать так чтобы на каждую почту python брал новый прокси

import time
import random
import string
from threading import Thread
from selenium import webdriver


def generate_data():
    amount = 10
    letters = string.ascii_lowercase + string.digits
    username = ''.join(random.sample(letters, amount))
    family = ''.join(random.sample(letters, amount))
    nameuser = ''.join(random.sample(letters, amount))
    pasword = ''.join(random.sample(letters, amount))
    pasword2 = ''.join(random.sample(letters, amount))
    
    return username, family, nameuser, pasword, pasword2


def main(data):
    driver = webdriver.Chrome('C:\\Users\\Dis\\Desktop\\gmail\\chromedriver.exe')
    driver.get('https://accounts.google.com/signup/v2/webcreateaccount?service=mail&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&ltmpl=default&gmb=exp&biz=false&flowName=GlifWebSignIn&flowEntry=SignUp')
    time.sleep(1)

    username = driver.find_element_by_xpath('//*[@id="firstName"]')
    username.send_keys(data[0])

    family = driver.find_element_by_xpath('//*[@id="lastName"]')
    family.send_keys(data[0])

    nameuser = driver.find_element_by_id('username')
    nameuser.send_keys(data[1])

    pasword = driver.find_element_by_xpath('//*[@id="passwd"]/div[1]/div/div[1]/input')
    pasword.send_keys(data[2])

    pasword2 = driver.find_element_by_xpath('//*[@id="confirm-passwd"]/div[1]/div/div[1]/input')
    pasword2.send_keys(data[2])

    confirm = driver.find_element_by_xpath('//*[@id="accountDetailsNext"]/span/span').click()

    with open('accounts.txt', 'a') as f:
        f.write(data[1] + '@gmail.com'+ ':' + data[2] + '\n')

    time.sleep(5)
    driver.quit()

def create_thread(amount):
    for t in range(amount):
        t = Thread(target=main, args=(generate_data(),))
        t.start()


if __name__ in '__main__':
    create_thread(amount=int(input('Количество потоков: ')))

Ответы (0 шт):