def create_account():

    try:
        #creating a chrome object instance to open browser
        driver = webdriver.Chrome(chrome_options)

        driver.get('https://www.instagram.com/')

        #username
        name = accnt.username()

        #id
        count = 0

        #fill the email value
        email_field = driver.find_element_by_name('emailOrPhone')
        email_field.send_keys(accnt.genEmail())

        #fill the fullname value
        fullname_field = driver.find_element_by_name('fullName')
        fullname_field.send_keys(accnt.genName())

        #fill username value
        username_field = driver.find_element_by_name('username')
        username_field.send_keys(name)

        #fill password value
        password_field = driver.find_element_by_name('password')
        passW = accnt.generatePassword()
        password_field.send_keys(passW)

        submit = driver.find_element_by_xpath(
            '//*[@id="react-root"]/section/main/article/div[2]/div[1]/div/form/div[6]/span/button'
        )
        submit.click()
        print('Registering....')
        """
        DEPRECATED - CODE 
        #skip image 
        driver.get('https://www.instagram.com/accounts/registered/')
        skip = driver.find_element_by_xpath('//*[@id="react-root"]/div/div/div[1]/button')
        skip.click()
        print('skipping...')

        #skip facebook connect
        driver.get('https://www.instagram.com/accounts/registered/1')
        skip_one = driver.find_element_by_xpath('//*[@id="react-root"]/div/div/div[2]/button')
        skip_one.click()
        print('skipping...')    
        """

        storeinfirebase(name)

        sleep(1)
        driver.close()
    except Exception as e:
        print(e)
def create_account():
    try:

        driver.get('https://www.instagram.com/')

        #username
        name = accnt.username()

        #fill the email value
        email_field = driver.find_element_by_name('emailOrPhone')
        email_field.send_keys(accnt.genEmail())

        #fill the fullname value
        fullname_field = driver.find_element_by_name('fullName')
        fullname_field.send_keys(accnt.genName())

        #fill username value
        username_field = driver.find_element_by_name('username')
        username_field.send_keys(name)

        #fill password value
        password_field = driver.find_element_by_name('password')
        passW = accnt.generatePassword()
        password_field.send_keys(passW)

        submit = driver.find_element_by_xpath(
            '//*[@id="react-root"]/section/main/article/div[2]/div[1]/div/form/div[6]/span/button'
        )
        submit.click()

        print('Registering....')

        storeinfirebase(name)

        sleep(1)
        driver.close()
    except Exception as e:
        print(e)
Exemple #3
0
    def createaccount(self, proxy=None):
        chrome_options = webdriver.ChromeOptions()
        if proxy != None:
            chrome_options.add_argument('--proxy-server=%s' % proxy)

        driver = webdriver.Chrome(chrome_options=chrome_options)
        driver.get(self.url)
        sleep(5)
        name = accnt.username()
        # username

        # fill the email value
        email_field = driver.find_element_by_name('emailOrPhone')
        email_field.send_keys(accnt.genEmail())

        # fill the fullname value
        fullname_field = driver.find_element_by_name('fullName')
        fullname_field.send_keys(accnt.genName())

        # fill username value
        username_field = driver.find_element_by_name('username')
        username_field.send_keys(name)

        # fill password value
        password_field = driver.find_element_by_name('password')
        passW = accnt.generatePassword()
        password_field.send_keys(passW)

        submit = driver.find_element_by_xpath(
            '//*[@id="react-root"]/section/main/article/div[2]/div[1]/div/form/div[7]/div/button')
        submit.click()

        print('Registering....')
        store(name)

        sleep(4)
        driver.close()
Exemple #4
0
def create_account():
    try:
        if config.Config['has_proxy_file'] == False:
            chrome_options = webdriver.ChromeOptions()
            chrome_options.add_argument('--proxy-server=%s' %
                                        config.Config['proxy_server'])

            #creating a chrome object instance to open browser
            driver = webdriver.Chrome(chrome_options=chrome_options)
            driver.get('https://www.instagram.com/')
            sleep(3)

            name = accnt.username()
            #username

            #fill the email value
            email_field = driver.find_element_by_name('emailOrPhone')
            email_field.send_keys(accnt.genEmail())

            #fill the fullname value
            fullname_field = driver.find_element_by_name('fullName')
            fullname_field.send_keys(accnt.genName())

            #fill username value
            username_field = driver.find_element_by_name('username')
            username_field.send_keys(name)

            #fill password value
            password_field = driver.find_element_by_name('password')
            passW = accnt.generatePassword()
            password_field.send_keys(passW)

            submit = driver.find_element_by_xpath(
                '//*[@id="react-root"]/section/main/article/div[2]/div[1]/div/form/div[6]/span/button'
            )
            submit.click()

            print('Registering....')

            storeinfirebase(name)

            sleep(1)
            driver.close()

        else:
            with open(
                    config.Config['proxy_file']['proxy_server_txt_file_path'],
                    'r') as file:
                content = file.read().splitlines()
                for proxy in content:
                    chrome_options = webdriver.ChromeOptions()
                    chrome_options.add_argument('--proxy-server=%s' % proxy)

                    #creating a chrome object instance to open browser
                    driver = webdriver.Chrome(chrome_options=chrome_options)

                    amount_per_proxy = config.Config['proxy_file'][
                        'profile_per_proxy']

                    if amount_per_proxy != 0:

                        print("Creating {} amount of users for this proxy".
                              format(amount_per_proxy))

                        for i in range(0, amount_per_proxy):
                            driver.get('https://www.instagram.com/')
                            sleep(3)
                            #username
                            name = accnt.username()

                            #fill the email value
                            email_field = driver.find_element_by_name(
                                'emailOrPhone')
                            email_field.send_keys(accnt.genEmail())

                            #fill the fullname value
                            fullname_field = driver.find_element_by_name(
                                'fullName')
                            fullname_field.send_keys(accnt.genName())

                            #fill username value
                            username_field = driver.find_element_by_name(
                                'username')
                            username_field.send_keys(name)

                            #fill password value
                            password_field = driver.find_element_by_name(
                                'password')
                            passW = accnt.generatePassword()
                            password_field.send_keys(passW)

                            submit = driver.find_element_by_xpath(
                                '//*[@id="react-root"]/section/main/article/div[2]/div[1]/div/form/div[6]/span/button'
                            )
                            submit.click()

                            print('Registering....')

                            storeinfirebase(name)

                            sleep(1)
                            driver.close()

                    else:
                        random_number = randint(1, 20)

                        print("Creating {} amount of users for this proxy".
                              format(random_number))
                        for i in range(0, random_number):
                            driver.get('https://www.instagram.com/')
                            sleep(3)
                            #username
                            name = accnt.username()

                            #fill the email value
                            email_field = driver.find_element_by_name(
                                'emailOrPhone')
                            email_field.send_keys(accnt.genEmail())

                            #fill the fullname value
                            fullname_field = driver.find_element_by_name(
                                'fullName')
                            fullname_field.send_keys(accnt.genName())

                            #fill username value
                            username_field = driver.find_element_by_name(
                                'username')
                            username_field.send_keys(name)

                            #fill password value
                            password_field = driver.find_element_by_name(
                                'password')
                            passW = accnt.generatePassword()
                            password_field.send_keys(passW)

                            submit = driver.find_element_by_xpath(
                                '//*[@id="react-root"]/section/main/article/div[2]/div[1]/div/form/div[6]/span/button'
                            )
                            submit.click()

                            print('Registering....')

                            storeinfirebase(name)

                            sleep(1)
                            driver.close()

    except Exception as e:
        print(e)
        driver.close()
    def createaccount(self, proxy=None):
        chrome_options = webdriver.ChromeOptions()
        if proxy != None:
            chrome_options.add_argument('--proxy-server=%s' % proxy)

        chrome_options.add_argument('headless')
        chrome_options.add_argument('window-size=1200x600')
        driver = webdriver.Chrome(chrome_options=chrome_options)
        print('Opening Browser')
        driver.get(self.url)

        print('Browser Opened')
        sleep(5)

        print('Generating username')
        name = accnt.username()
        print('username Generated')
        # username

        action_chains = ActionChains(driver)
        sleep(5)
        # username
        account_info = accnt.new_account()

        # fill the email value
        print('Filling email field')
        email_field = driver.find_element_by_name('emailOrPhone')

        email_field.send_keys(accnt.genEmail())
        sleep(1)

        action_chains.move_to_element(email_field)
        email_field.send_keys(account_info["email"])

        sleep(2)

        # fill the fullname value
        print('Filling fullname field')
        fullname_field = driver.find_element_by_name('fullName')
        action_chains.move_to_element(fullname_field)
        fullname_field.send_keys(account_info["name"])

        sleep(2)

        # fill username value
        print('Filling username field')
        username_field = driver.find_element_by_name('username')
        action_chains.move_to_element(username_field)
        username_field.send_keys(account_info["username"])

        sleep(2)

        # fill password value
        print('Filling password field')
        password_field = driver.find_element_by_name('password')
        action_chains.move_to_element(password_field)
        passW = account_info["password"]
        password_field.send_keys(passW)
        sleep(1)

        sleep(2)

        submit = driver.find_element_by_xpath(
            '//*[@id="react-root"]/section/main/article/div[2]/div[1]/div/form/div[7]/div/button'
        )

        action_chains.move_to_element(submit)

        sleep(2)
        submit.click()

        sleep(3)

        age_button = driver.find_element_by_xpath(
            "//input[@name='ageRadio' and @value='above_18']")
        age_button.click()

        sleep(2)
        next_button = driver.find_elements_by_xpath(
            '//button[text()="Next"]')[1]
        next_button.click()

        sleep(4)
        # After the first fill save the account account_info
        store(account_info)

        # Activate the account
        confirm_url = get_activation_url(account_info['email'])
        logging.info("The confirm url is {}".format(confirm_url))
        driver.get(confirm_url)

        driver.close()
def runBot():
    for i in range(Config['amount_of_account']):
        account = CreateAccount(genEmail(), username(),
                                str(Config['password']), genName(),
                                Config['amount_of_account'])
        account.createaccount()