Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name 'parser' is not defined #63

Open
DesTroTN opened this issue Oct 13, 2022 · 4 comments
Open

NameError: name 'parser' is not defined #63

DesTroTN opened this issue Oct 13, 2022 · 4 comments

Comments

@DesTroTN
Copy link

args = parser.parse_args()
NameError: name 'parser' is not defined

@VezlysNikita
Copy link

Did you solve this problem?

@viktorashi
Copy link

ong

@dinlazyazilim
Copy link

pip install argparse
pip install --upgrade fake-useragent
clear.py create python file in

from fake_useragent import UserAgent
ua = UserAgent()
ua.update()

python clear.py

accountInfoGenerator.py code -------------->>>>>>>>>>

from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from fake_useragent import UserAgent
import accountInfoGenerator as account
import getVerifCode as verifiCode
from selenium import webdriver
import fakeMail as email
import time

ua = UserAgent()
userAgent = ua.random
print(userAgent)

#replace 'your path here' with your chrome binary absolute path
driver = webdriver.Opera(executable_path=r'./operadriver.exe')
#saves the login & pass into accounts.txt file.
acc = open("accounts.txt", "a")

driver.get("https://www.instagram.com/accounts/emailsignup/")
time.sleep(8)
try:
cookie = WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.XPATH,
'/html/body/div[3]/div/div/button[1]'))).click()
except:
pass
name = account.username()

Fill the email value

email_field = driver.find_element_by_name('emailOrPhone')
fake_email = email.getFakeMail()
email_field.send_keys(fake_email)
print(fake_email)

Fill the fullname value

fullname_field = driver.find_element_by_name('fullName')
fullname_field.send_keys(account.generatingName())
print(account.generatingName())

Fill username value

username_field = driver.find_element_by_name('username')
username_field.send_keys(name)
print(name)

Fill password value

password_field = driver.find_element_by_name('password')
acc_password = account.generatePassword()
password_field.send_keys(acc_password) # You can determine another password here.

print(name+":"+acc_password, file=acc)

acc.close()

button_xpath = "//*[@id='react-root']/section/main/div/div/div[1]/div/form/div[7]/div/button"
button_element = WebDriverWait(driver, 25).until(EC.element_to_be_clickable((By.XPATH, button_xpath)))
button_element.click()
time.sleep(8)

#Birthday verification
driver.find_element_by_xpath("//[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[1]/select").click()
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//
[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[1]/select/option[4]"))).click()

driver.find_element_by_xpath("//[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[2]/select").click()
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//
[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[2]/select/option[10]"))).click()

driver.find_element_by_xpath("//[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[3]/select").click()
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//
[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[3]/select/option[27]"))).click()

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//*[@id='react-root']/section/main/div/div/div[1]/div/div[6]/button"))).click()
time.sleep(3)

fMail = fake_email[0].split("@")
mailName = fMail[0]
domain = fMail[1]
instCode = verifiCode.getInstVeriCode(mailName, domain, driver)
driver.find_element_by_name('email_confirmation_code').send_keys(instCode, Keys.ENTER)
time.sleep(10)

#accepting the notifications.
driver.find_element_by_xpath("/html/body/div[4]/div/div/div/div[3]/button[2]").click()
time.sleep(2)

#logout
driver.find_element_by_xpath(
"//[@id='react-root']/section/nav/div[2]/div/div/div[3]/div/div[5]/span/img").click()
driver.find_element_by_xpath(
"//
[@id='react-root']/section/nav/div[2]/div/div/div[3]/div/div[5]/div[2]/div[2]/div[2]/div[2]/div").click()

try:
not_valid = driver.find_element_by_xpath('/html/body/div[1]/section/main/div/div/div[1]/div[2]/form/div/div[4]/div')
if(not_valid.text == 'That code isn't valid. You can request a new one.'):
time.sleep(1)
driver.find_element_by_xpath('/html/body/div[1]/section/main/div/div/div[1]/div[1]/div[2]/div/button').click()
time.sleep(10)
instCodeNew = verifiCode.getInstVeriCodeDouble(mailName, domain, driver, instCode)
confInput = driver.find_element_by_name('email_confirmation_code')
confInput.send_keys(Keys.CONTROL + "a")
confInput.send_keys(Keys.DELETE)
confInput.send_keys(instCodeNew, Keys.ENTER)
except:
pass

time.sleep(5)
driver.quit()

driver.find_element_by_xpath("//*[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[1]/select").click

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//*[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[1]/select/option[4]"))).click()

driver.find_element_by_xpath("//[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[2]/select").click()
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//
[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[2]/select/option[10]"))).click()

driver.find_element_by_xpath("//[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[3]/select").click()
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//
[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[3]/select/option[27]"))).click()

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//*[@id='react-root']/section/main/div/div/div[1]/div/div[6]/button"))).click()
time.sleep(3)

fMail = fake_email[0].split("@")
mailName = fMail[0]
domain = fMail[1]
instCode = verifiCode.getInstVeriCode(mailName, domain, driver)
driver.find_element_by_name('email_confirmation_code').send_keys(instCode, Keys.ENTER)
time.sleep(10)

Accepting the notifications.

driver.find_element_by_xpath("/html/body/div[4]/div/div/div/div[3]/button[2]").click()
time.sleep(2)

Logout

driver.find_element_by_xpath(
"//[@id='react-root']/section/nav/div[2]/div/div/div[3]/div/div[5]/span/img").click()
driver.find_element_by_xpath(
"//
[@id='react-root']/section/nav/div[2]/div/div/div[3]/div/div[5]/div[2]/div[2]/div[2]/div[2]/div").click()

try:
not_valid = driver.find_element_by_xpath('/html/body/div[1]/section/main/div/div/div[1]/div[2]/form/div/div[4]/div')
if not_valid.text == "That code isn't valid. You can request a new one.":
time.sleep(1)
driver.find_element_by_xpath('/html/body/div[1]/section/main/div/div/div[1]/div[1]/div[2]/div/button').click()
time.sleep(10)
instCodeNew = verifiCode.getInstVeriCodeDouble(mailName, domain, driver, instCode)
confInput = driver.find_element_by_name('email_confirmation_code')
confInput.send_keys(Keys.CONTROL + "a")
confInput.send_keys(Keys.DELETE)
confInput.send_keys(instCodeNew, Keys.ENTER)
except:
pass

time.sleep(5)
driver.quit()

@priyaank2004
Copy link

pip install argparse

pip install --upgrade fake-useragent
clear.py create python file in

from fake_useragent import UserAgent

ua = UserAgent()
ua.update()
python clear.py

accountInfoGenerator.py code -------------->>>>>>>>>>

from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from fake_useragent import UserAgent import accountInfoGenerator as account import getVerifCode as verifiCode from selenium import webdriver import fakeMail as email import time

ua = UserAgent() userAgent = ua.random print(userAgent)

#replace 'your path here' with your chrome binary absolute path driver = webdriver.Opera(executable_path=r'./operadriver.exe') #saves the login & pass into accounts.txt file. acc = open("accounts.txt", "a")

driver.get("https://www.instagram.com/accounts/emailsignup/") time.sleep(8) try: cookie = WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.XPATH, '/html/body/div[3]/div/div/button[1]'))).click() except: pass name = account.username()

Fill the email value

email_field = driver.find_element_by_name('emailOrPhone') fake_email = email.getFakeMail() email_field.send_keys(fake_email) print(fake_email)

Fill the fullname value

fullname_field = driver.find_element_by_name('fullName') fullname_field.send_keys(account.generatingName()) print(account.generatingName())

Fill username value

username_field = driver.find_element_by_name('username') username_field.send_keys(name) print(name)

Fill password value

password_field = driver.find_element_by_name('password') acc_password = account.generatePassword() password_field.send_keys(acc_password) # You can determine another password here.

print(name+":"+acc_password, file=acc)

acc.close()

button_xpath = "//*[@id='react-root']/section/main/div/div/div[1]/div/form/div[7]/div/button" button_element = WebDriverWait(driver, 25).until(EC.element_to_be_clickable((By.XPATH, button_xpath))) button_element.click() time.sleep(8)

#Birthday verification driver.find_element_by_xpath("//[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[1]/select").click() WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[1]/select/option[4]"))).click()

driver.find_element_by_xpath("//[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[2]/select").click() WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[2]/select/option[10]"))).click()

driver.find_element_by_xpath("//[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[3]/select").click() WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[3]/select/option[27]"))).click()

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//*[@id='react-root']/section/main/div/div/div[1]/div/div[6]/button"))).click() time.sleep(3)

fMail = fake_email[0].split("@") mailName = fMail[0] domain = fMail[1] instCode = verifiCode.getInstVeriCode(mailName, domain, driver) driver.find_element_by_name('email_confirmation_code').send_keys(instCode, Keys.ENTER) time.sleep(10)

#accepting the notifications. driver.find_element_by_xpath("/html/body/div[4]/div/div/div/div[3]/button[2]").click() time.sleep(2)

#logout driver.find_element_by_xpath( "//[@id='react-root']/section/nav/div[2]/div/div/div[3]/div/div[5]/span/img").click() driver.find_element_by_xpath( "//[@id='react-root']/section/nav/div[2]/div/div/div[3]/div/div[5]/div[2]/div[2]/div[2]/div[2]/div").click()

try: not_valid = driver.find_element_by_xpath('/html/body/div[1]/section/main/div/div/div[1]/div[2]/form/div/div[4]/div') if(not_valid.text == 'That code isn't valid. You can request a new one.'): time.sleep(1) driver.find_element_by_xpath('/html/body/div[1]/section/main/div/div/div[1]/div[1]/div[2]/div/button').click() time.sleep(10) instCodeNew = verifiCode.getInstVeriCodeDouble(mailName, domain, driver, instCode) confInput = driver.find_element_by_name('email_confirmation_code') confInput.send_keys(Keys.CONTROL + "a") confInput.send_keys(Keys.DELETE) confInput.send_keys(instCodeNew, Keys.ENTER) except: pass

time.sleep(5) driver.quit()

driver.find_element_by_xpath("//*[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[1]/select").click

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//*[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[1]/select/option[4]"))).click()

driver.find_element_by_xpath("//[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[2]/select").click() WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[2]/select/option[10]"))).click()

driver.find_element_by_xpath("//[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[3]/select").click() WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//[@id='react-root']/section/main/div/div/div[1]/div/div[4]/div/div/span/span[3]/select/option[27]"))).click()

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//*[@id='react-root']/section/main/div/div/div[1]/div/div[6]/button"))).click() time.sleep(3)

fMail = fake_email[0].split("@") mailName = fMail[0] domain = fMail[1] instCode = verifiCode.getInstVeriCode(mailName, domain, driver) driver.find_element_by_name('email_confirmation_code').send_keys(instCode, Keys.ENTER) time.sleep(10)

Accepting the notifications.

driver.find_element_by_xpath("/html/body/div[4]/div/div/div/div[3]/button[2]").click() time.sleep(2)

Logout

driver.find_element_by_xpath( "//[@id='react-root']/section/nav/div[2]/div/div/div[3]/div/div[5]/span/img").click() driver.find_element_by_xpath( "//[@id='react-root']/section/nav/div[2]/div/div/div[3]/div/div[5]/div[2]/div[2]/div[2]/div[2]/div").click()

try: not_valid = driver.find_element_by_xpath('/html/body/div[1]/section/main/div/div/div[1]/div[2]/form/div/div[4]/div') if not_valid.text == "That code isn't valid. You can request a new one.": time.sleep(1) driver.find_element_by_xpath('/html/body/div[1]/section/main/div/div/div[1]/div[1]/div[2]/div/button').click() time.sleep(10) instCodeNew = verifiCode.getInstVeriCodeDouble(mailName, domain, driver, instCode) confInput = driver.find_element_by_name('email_confirmation_code') confInput.send_keys(Keys.CONTROL + "a") confInput.send_keys(Keys.DELETE) confInput.send_keys(instCodeNew, Keys.ENTER) except: pass

time.sleep(5) driver.quit()

does your code work - what i mean is that- does your created acct work or gets banned?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants