I want to create email on protonmail.com with selenium But I can not go beyond the sign up page i can not find username field and send text to it. Why??what is the problem ?? And what is the solution?
my code
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
import time
from selenium import webdriver
from random import randint
#setuser=set()
#def randomuser():
# name='ahmad'
# num=randint(10000,999999)
# return f'{name}{num}{name[:randint(0,5)]}'
d=webdriver.Chrome()
d.get('https://protonmail.com/signup')
WebDriverWait(d, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="signup-plans"]/div[5]/div[1]/div[1]/div/div[3]/i[1]'))).click()
WebDriverWait(d, 4).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="freePlan"]'))).click()
WebDriverWait(d, 10).until(EC.element_to_be_clickable((By.XPATH,'//*[@id="password"]'))).send_keys('12345678')
WebDriverWait(d, 4).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="repeat-password"]'))).send_keys('12345678')
try:
time.sleep(3)
d.find_element_by_css_selector('#username').send_keys('username')
d.find_element_by_css_selector('#username').submit()
except:
WebDriverWait(d, 10).until(EC.frame_to_be_available_and_switch_to_it(d.find_element_by_xpath('//iframe')))
user=d.find_element_by_xpath('//body[@class="color-norm bg-norm sign-layout-container"]//*[@id="username"]')
user.send_keys('username')
user.send_keys(Keys.ENTER)
time.sleep(3)
user.send_keys(Keys.ENTER)