[Python] Como faço para consiguir receber sms online?Usando Python e Selenium [fechada]

Discussão em 'Python' iniciado por Stack, Janeiro 28, 2025.

  1. Stack

    Stack Membro Participativo

    Estou tentando criar um codigo para criar emails no goglee crhome usando selenium, porém em determinada area do processo não consigo provar que não sou um robo. Eles pedem uma verificacao via sms. Como posso fazer isso?

    codigo abaixo:

    #criar conta fake
    #abrir o navegador
    from selenium.webdriver.common.keys import Keys
    from selenium.webdriver import ActionChains
    from selenium.webdriver.common.by import By
    from selenium import webdriver
    from selenium.webdriver.chrome.service import Service
    from webdriver_manager.chrome import ChromeDriverManager
    import time

    driver2 = webdriver.Chrome()



    time.sleep(4)
    #entrar no site
    driver2.get('https://www.google.com/intl/pt-BR/account/about/')
    time.sleep(4)
    #clicar em criar conta
    driver2.find_element('xpath','/html/body/header/div[1]/div[5]/ul/li[1]').click()

    #Dados fake
    from selenium.webdriver.common.keys import Keys


    import random
    from faker import Faker

    fake = Faker()
    nome = fake.name()
    sobrenome = fake.name()
    #nome
    driver2.find_element('xpath','//*[@id="firstName"]').click()
    driver2.find_element('xpath','//*[@id="firstName"]').send_keys(nome)
    time.sleep(3)
    #sobrenome
    driver2.find_element('xpath','//*[@id="lastName"]').click()
    driver2.find_element('xpath','//*[@id="lastName"]').send_keys(sobrenome)
    time.sleep(3)
    #concluir
    driver2.find_element('xpath','//*[@id="lastName"]').send_keys(Keys.ENTER)
    time.sleep(3)

    #data de nascimento

    #dia
    time.sleep(2)
    dia = random.randrange(1, 28)
    driver2.find_element('xpath','//*[@id="day"]').click()
    driver2.find_element('xpath','//*[@id="day"]').send_keys(dia)

    #mes
    time.sleep(3)
    mes = random.randrange(1,12)
    driver2.find_element('xpath','//*[@id="month"]').click()
    time.sleep(2)
    if mes ==1:
    driver2.find_element('xpath','//*[@id="month"]/option[1]').click()
    elif mes ==2:
    driver2.find_element('xpath','//*[@id="month"]/option[2]').click()
    elif mes ==3:
    driver2.find_element('xpath','//*[@id="month"]/option[3]').click()
    elif mes ==4:
    driver2.find_element('xpath','//*[@id="month"]/option[4]').click()
    elif mes ==5:
    driver2.find_element('xpath','//*[@id="month"]/option[5]').click()
    elif mes ==6:
    driver2.find_element('xpath','//*[@id="month"]/option[6]').click()
    elif mes ==7:
    driver2.find_element('xpath','//*[@id="month"]/option[7]').click()
    elif mes ==8:
    driver2.find_element('xpath','//*[@id="month"]/option[8]').click()
    elif mes ==9:
    driver2.find_element('xpath','//*[@id="month"]/option[9]').click()
    elif mes ==10:
    driver2.find_element('xpath','//*[@id="month"]/option[10]').click()
    elif mes ==11:
    driver2.find_element('xpath','//*[@id="month"]/option[11]').click()
    elif mes ==12:
    driver2.find_element('xpath','//*[@id="month"]/option[12]').click()

    #ano
    time.sleep(4)
    ano = (2025) - random.randrange(18,65)
    driver2.find_element('xpath','/html/body/div[1]/div[1]/div[2]/c-wiz/div/div[2]/div/div/div/form/span/section/div/div/div[1]/div[3]/div/div/div[1]/div/div[1]/input').click()
    driver2.find_element('xpath','/html/body/div[1]/div[1]/div[2]/c-wiz/div/div[2]/div/div/div/form/span/section/div/div/div[1]/div[3]/div/div/div[1]/div/div[1]/input').send_keys(ano)

    #genero
    genero = random.randrange(1,3)
    time.sleep(2)
    driver2.find_element('xpath','//*[@id="gender"]').click()
    if genero ==1:
    driver2.find_element('xpath','//*[@id="gender"]/option[2]').click()
    elif genero ==2:
    driver2.find_element('xpath','//*[@id="gender"]/option[3]').click()
    elif genero ==3:
    driver2.find_element('xpath','//*[@id="gender"]/option[4]').click()

    #concluir
    driver2.find_element('xpath','//*[@id="day"]').click()
    i =1
    while True:
    driver2.find_element('xpath','//*[@id="day"]').send_keys(Keys.TAB)
    i=i+1
    time.sleep(0.5)
    if i>6:
    driver2.find_element('xpath','//*[@id="day"]').send_keys(Keys.ENTER)
    break

    #gerando email
    time.sleep(3)
    driver2.find_element('xpath','//*[@id="yDmH0d"]/c-wiz/div/div[2]/div/div/div/form/span/section/div/div/div[1]/div[1]/div/span/div[3]/div/div[1]/div/div[3]/div').click()
    time.sleep(2)
    driver2.find_element('xpath','//*[@id="yDmH0d"]/c-wiz/div/div[2]/div/div/div/form/span/section/div/div/div[2]/div[1]/div/div[1]/div/div[1]/input').click()
    bemail = (nome+sobrenome+str(random.randrange(1,99999)))
    if len(bemail)>29:
    bemail = bemail[0,29]
    email = bemail.replace(' ','')
    driver2.find_element('xpath','//*[@id="yDmH0d"]/c-wiz/div/div[2]/div/div/div/form/span/section/div/div/div[2]/div[1]/div/div[1]/div/div[1]/input').send_keys(email)
    email= email+'@gmail.com'
    email = email.replace(' ','')
    #concluir
    driver2.find_element('xpath','//*[@id="yDmH0d"]/c-wiz/div/div[2]/div/div/div/form/span/section/div/div/div[2]/div[1]/div/div[1]/div/div[1]/input').send_keys(Keys.ENTER)
    time.sleep(4)
    #senha
    senha = fake.password()
    print(senha)
    driver2.find_element('xpath','//*[@id="passwd"]/div[1]/div/div[1]/input').click()
    driver2.find_element('xpath','//*[@id="passwd"]/div[1]/div/div[1]/input').send_keys(senha)
    driver2.find_element('xpath','//*[@id="passwd"]/div[1]/div/div[1]/input').send_keys(Keys.ENTER)
    driver2.find_element('xpath','//*[@id="confirm-passwd"]/div[1]/div/div[1]/input').send_keys(senha)
    time.sleep(3)
    driver2.find_element('xpath','//*[@id="confirm-passwd"]/div[1]/div/div[1]/input').send_keys(Keys.ENTER)

    Continue reading...

Compartilhe esta Página