• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.
    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Python Why is this repeating?

Sago

Active Coder
Hey!
I'm making a discord account creator, and while there's a bit of a problem It repeats the month in the day box. Here is my code...
acc.py:
#imports
import os, time, random, spintax, requests, pyperclip
import numpy as np
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from random import randint, randrange
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException

months = [
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
    "July",
    "August",
    "September",
    "October",
    "November",
    "December"
]

days = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29"]

PROXY = "3.88.169.225:80"
happy = True
sad = False


def stop(n):
    time.sleep(randint(2, n))

def password(happy, sad):

    op = webdriver.ChromeOptions()
    # op.binary_location = os.environ.get("GOOGLE_CHROME_BIN")
    # op.add_argument('--headless')
    op.add_argument('--disable-dev-shm-usage')
    # op.add_argument('--no-sandbox')
    op.add_argument('--disable-gpu')
    # op.add_argument("--window-size=1920,1080")
    op.add_argument("disable-infobars")
    op.add_argument("--disable-extensions")
    # op.add_argument('--proxy-server=%s' % PROXY)
    # op.add_argument("--proxy-bypass-list=*")
    driver = webdriver.Chrome(options=op, executable_path= 'chromedriver.exe')
    driver.execute_script("document.body.style.zoom='80%'")
    action = webdriver.ActionChains(driver)
    driver.get('https://discord.com/register')

    file = open("emails.txt")
    emaillines = file.readlines()
    allemails = len(emaillines)
    
    passfile = open("passwords.txt")
    passlines = passfile.readlines()
    allpasses = len(passlines)

    #randomemail = randint(1, allemails)
    #css-gvi9bl-control
    #(lines[randomemail])

    emailfield = driver.find_element_by_xpath('//*[@class="inputDefault-_djjkz input-cIJ7To"]')
    emailfield.click()
    emailfield.send_keys(emaillines[randint(1, allemails)])

    time.sleep(0.255)

    usernamefield = driver.find_element_by_xpath('//*[@name="username"]')
    usernamefield.click()
    usernamefield.send_keys("Goodby37848")
    
    passfield = driver.find_element_by_xpath('//*[@name="password"]')
    passfield.click()
    passfield.send_keys(passlines[randint(1, allpasses)])

    monthfield = driver.find_element_by_xpath('//*[@class="css-1hwfws3"]')
    monthfield.click()
    action.send_keys(random.choice(months)).perform()

    time.sleep(0.255)
    driver.find_element_by_xpath('//*[@class="css-o3gndj-placeholder"]').click()
    action.send_keys(random.choice(days)).perform()

    #monthfield.select_by_visible_text(months)

    return driver
    
    driver.quit()

    #button GenerateBtn

if __name__ == '__main__':

    driver = password(happy, sad)
 

Antero360

Coder
Hey!
I'm making a discord account creator, and while there's a bit of a problem It repeats the month in the day box. Here is my code...
acc.py:
#imports
import os, time, random, spintax, requests, pyperclip
import numpy as np
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from random import randint, randrange
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException

months = [
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
    "July",
    "August",
    "September",
    "October",
    "November",
    "December"
]

days = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29"]

PROXY = "3.88.169.225:80"
happy = True
sad = False


def stop(n):
    time.sleep(randint(2, n))

def password(happy, sad):

    op = webdriver.ChromeOptions()
    # op.binary_location = os.environ.get("GOOGLE_CHROME_BIN")
    # op.add_argument('--headless')
    op.add_argument('--disable-dev-shm-usage')
    # op.add_argument('--no-sandbox')
    op.add_argument('--disable-gpu')
    # op.add_argument("--window-size=1920,1080")
    op.add_argument("disable-infobars")
    op.add_argument("--disable-extensions")
    # op.add_argument('--proxy-server=%s' % PROXY)
    # op.add_argument("--proxy-bypass-list=*")
    driver = webdriver.Chrome(options=op, executable_path= 'chromedriver.exe')
    driver.execute_script("document.body.style.zoom='80%'")
    action = webdriver.ActionChains(driver)
    driver.get('https://discord.com/register')

    file = open("emails.txt")
    emaillines = file.readlines()
    allemails = len(emaillines)
   
    passfile = open("passwords.txt")
    passlines = passfile.readlines()
    allpasses = len(passlines)

    #randomemail = randint(1, allemails)
    #css-gvi9bl-control
    #(lines[randomemail])

    emailfield = driver.find_element_by_xpath('//*[@class="inputDefault-_djjkz input-cIJ7To"]')
    emailfield.click()
    emailfield.send_keys(emaillines[randint(1, allemails)])

    time.sleep(0.255)

    usernamefield = driver.find_element_by_xpath('//*[@name="username"]')
    usernamefield.click()
    usernamefield.send_keys("Goodby37848")
   
    passfield = driver.find_element_by_xpath('//*[@name="password"]')
    passfield.click()
    passfield.send_keys(passlines[randint(1, allpasses)])

    monthfield = driver.find_element_by_xpath('//*[@class="css-1hwfws3"]')
    monthfield.click()
    action.send_keys(random.choice(months)).perform()

    time.sleep(0.255)
    driver.find_element_by_xpath('//*[@class="css-o3gndj-placeholder"]').click()
    action.send_keys(random.choice(days)).perform()

    #monthfield.select_by_visible_text(months)

    return driver
   
    driver.quit()

    #button GenerateBtn

if __name__ == '__main__':

    driver = password(happy, sad)
can you post a screenshot of the issue? I looked through your code, and I'm not finding anything wrong...
 
Top