From bcdec4435fa01b992bdf9846745e9f94ab9a96ff Mon Sep 17 00:00:00 2001 From: moonniketan Date: Tue, 1 Jun 2021 01:07:19 +0530 Subject: [PATCH 1/3] Added csv file for storing usernames --- modules/storeusername.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/storeusername.py b/modules/storeusername.py index c9ff0a16..dae78a4b 100644 --- a/modules/storeusername.py +++ b/modules/storeusername.py @@ -1,9 +1,25 @@ from .config import Config, ASSET_DIR import logging import pickle +import csv def store(account): with open(ASSET_DIR + '/usernames.pkl', 'ab') as f: logging.info("Storing username {}".format(str(account['username']))) logging.info(str(account)) pickle.dump(str(account), f, pickle.HIGHEST_PROTOCOL) + + # storing username.csv file + with open('usernames.csv', 'w', newline='') as file: + logging.info("Storing username {}".format(str(account['username']))) + logging.info(str(account)) + writer = csv.writer(file) + writer.writerow(["Name", "Username", "Password", "Email", "Gender", "Birthday"]) + writer.writerow([ + account["name"], + account["username"], + account["password"], + account["email"], + account["gender"], + account["birthday"] + ]) From 98a6b4f44ff384de322ea71d71d48ec63cef95d1 Mon Sep 17 00:00:00 2001 From: moonniketan Date: Tue, 1 Jun 2021 01:11:56 +0530 Subject: [PATCH 2/3] Added changes to the path of instagram signup page --- modules/seleniumbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/seleniumbot.py b/modules/seleniumbot.py index 228d437b..57142647 100644 --- a/modules/seleniumbot.py +++ b/modules/seleniumbot.py @@ -28,7 +28,7 @@ def __init__(self, use_custom_proxy, use_local_ip_address): self.sockets = [] self.use_custom_proxy = use_custom_proxy self.use_local_ip_address = use_local_ip_address - self.url = 'https://www.instagram.com/' + self.url = 'https://www.instagram.com/accounts/emailsignup/' self.__collect_sockets() From 0f298c28a020a262c73c1088503d478c3771c956 Mon Sep 17 00:00:00 2001 From: moonniketan Date: Tue, 1 Jun 2021 01:16:49 +0530 Subject: [PATCH 3/3] Corrected the signup button xpath Corrected the second flow that is verifying the birthday --- modules/seleniumbot.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/seleniumbot.py b/modules/seleniumbot.py index 57142647..9df2e88d 100644 --- a/modules/seleniumbot.py +++ b/modules/seleniumbot.py @@ -103,7 +103,7 @@ def createaccount(self, proxy=None): sleep(2) submit = driver.find_element_by_xpath( - '//*[@id="react-root"]/section/main/article/div[2]/div[1]/div/form/div[7]/div/button') + '//*[@id="react-root"]/section/main/div/div/div[1]/div/form/div[7]/div/button') action_chains.move_to_element(submit) @@ -113,12 +113,20 @@ def createaccount(self, proxy=None): sleep(3) try: - age_button = driver.find_element_by_xpath( "//input[@name='ageRadio' and @value='above_18']") - age_button.click() - + month_button = driver.find_element_by_xpath( '//*[@id="react-root"]/section/main/div/div/div[1]/div/div[4]/div/div/span/span[1]/select') + month_button.click() + month_button.send_keys(account_info["birthday"].split(" ")[0]) + sleep(1) + day_button = driver.find_element_by_xpath('//*[@id="react-root"]/section/main/div/div/div[1]/div/div[4]/div/div/span/span[2]/select') + day_button.click() + day_button.send_keys(account_info["birthday"].split[" "][1][:-1]) + sleep(1) + year_button = driver.find_element_by_xpath('//*[@id="react-root"]/section/main/div/div/div[1]/div/div[4]/div/div/span/span[3]/select') + year_button.click() + year_button.send_keys(account_info["birthday"].split[" "][2]) sleep(2) - next_button = driver.find_elements_by_xpath('//button[text()="Next"]')[1] + next_button = driver.find_elements_by_xpath('//*[@id="react-root"]/section/main/div/div/div[1]/div/div[6]/button') next_button.click() except Exception as e :