Не могу разобраться с датами на mail.ru. Не находит элемент по XPATH. Данные об аккаунте записываются в отдельный файл на 74 строке. Выдает ошибку:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//option[contains(text(),'8')]"}
Все галочки уже ставит и все работает кроме этих дат.
import random
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
numerals = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
firstmailsuffix = "@mail.ru"
driver = webdriver.Chrome()
num = 0
keylogs = open("mails", "a+")
while (True):
num+=1
passwordfull = ""
keys = []
mailname = 'kazakvolskyoi'
for i in range(10):
if random.randint(0,1) == 0:
keys.append(random.choice(letters))
else:
keys.append(random.choice(numerals))
driver.get('https://account.mail.ru/signup?from=main_m_touch')
time.sleep(5)
mail = driver.find_element(By.XPATH, '//input[@name="partial_login"]')
password = driver.find_element(By.XPATH, '//input[@id="password"]')
password.click()
repeat = driver.find_element(By.XPATH, '//input[@id="repeatPassword"]')
fname = driver.find_element(By.XPATH, '//input[@id="fname"]')
lname = driver.find_element(By.XPATH, '//input[@id="lname"]')
gender = driver.find_element(By.XPATH, '/html/body/div[1]/div[3]/div/div[4]/div[4]/div/div/div/div/form/div[9]/div[2]/div/label[1]/div[1]/div[2]')
sday = driver.find_element(By.XPATH, '/html/body/div[1]/div[3]/div/div[4]/div[4]/div/div/div/div/form/div[6]/div[2]/div/div/div/div[1]/div/div/div/div[1]')
smonth = driver.find_element(By.XPATH, '/html/body/div[1]/div[3]/div/div[4]/div[4]/div/div/div/div/form/div[6]/div[2]/div/div/div/div[3]/div/div/div[1]/div[1]')
syear = driver.find_element(By.XPATH, '/html/body/div[1]/div[3]/div/div[4]/div[4]/div/div/div/div/form/div[6]/div[2]/div/div/div/div[5]/div/div/div/div[1]')
searchbutton = driver.find_element(By.XPATH, '/html/body/div[1]/div[3]/div/div[4]/div[4]/div/div/div/div/form/button')
fname.click()
fname.send_keys("Valorant")
lname.click()
lname.send_keys("Account")
gender.click()
sday.click()
day = driver.find_element(By.XPATH, "//option[contains(text(),'8')]")
day.click()
smonth.click()
month = driver.find_element(By.XPATH, "//option[contains(text(),'Март')]")
month.click()
syear.click()
year = driver.find_element(By.XPATH, "//option[contains(text(),'2000')]")
year.click()
mail.click()
mail.send_keys(str(mailname), str(num))
password.click()
for passkey in keys:
passwordfull += passkey
password.send_keys(passwordfull)
repeat.send_keys(passwordfull)
keylogs.write(f"Mail: {mailname}{num}{firstmailsuffix} // Password: {passwordfull}\n")
searchbutton.click()
time.sleep(4)
driver.close()