You are on page 1of 2

import time

from selenium import webdriver


import unittest
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.actions.interaction import KEY
from selenium.webdriver.common import keys
import pyperclip
import pyautogui

browser=webdriver.Chrome(executable_path="c:\webdrivers\chromedriver.exe")
time.sleep(2)
browser.get("https://temp-mail.org/en/")
time.sleep(4)
gmail=browser.find_element_by_xpath('//*[@id="tm-body"]/div[1]/div/div/div[2]/
div[1]/form/div[2]/button')
gmail=gmail.click()
b=pyperclip.paste()
print(b)
browser.execute_script("window.open('');")
time.sleep(2)
browser.switch_to.window(browser.window_handles[1])
browser.get("https://www.instagram.com/accounts/emailsignup/")
time.sleep(5)
email=browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/div/
div[1]/div/form/div[3]/div/label/input')
time.sleep(3)
email.click()
time.sleep(5)
email.send_keys(b)
name=browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/div/
div[1]/div/form/div[4]/div/label/input')
name.click()
name.send_keys("anjali roy")
user=browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/div/
div[1]/div/form/div[5]/div/label/input')
time.sleep(3)
user.click()
time.sleep(2)
user.send_keys("1anjalli.roy051")
print("User:",user)
passwrd=browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/div/
div[1]/div/form/div[6]/div/label/input')
passwrd.click()
passwrd.send_keys("anjali@123")
print("Password:",passwrd)
signup=browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/div/
div[1]/div/form/div[7]/div/button')
time.sleep(3)
signup.click()
time.sleep(3)
date=browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/div/
div[1]/div/div[4]/div/div/span/span[1]/select')
date.click()
month=browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/div/
div[1]/div/div[4]/div/div/span/span[1]/select/option[3]')
month.click()
day=browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/div/
div[1]/div/div[4]/div/div/span/span[2]')
day.click()
days=browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/div/
div[1]/div/div[4]/div/div/span/span[2]/select/option[4]').click()
year=browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/div/
div[1]/div/div[4]/div/div/span/span[3]')
years=browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/div/
div[1]/div/div[4]/div/div/span/span[3]/select/option[23]').click()
go=browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/div/
div[1]/div/div[6]/button').click()
time.sleep(1)
browser.switch_to.window(browser.window_handles[0])
time.sleep(1)
browser.execute_script("window.scrollBy(0,500)","")
time.sleep(30)
otp=browser.find_element_by_xpath('//*[@id="tm-body"]/main/div[1]/div/div[2]/
div[2]/div/div[1]/div/div[4]/ul/li[2]/div[1]/a/span[4]').get_attribute('innerText')
c=otp
print(c, type(c))
d=c[:6]
print(d,type(d))
browser.switch_to.window(browser.window_handles[1])
time.sleep(2)
code=browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/div/
div[1]/div[2]/form/div/div[1]/input').click()
time.sleep(2)
pyautogui.typewrite(d)
time.sleep(2)
created= browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/
div/div[1]/div[2]/form/div/div[2]/button').click()

You might also like