bournexu / autocreategmailaccount Goto Github PK
View Code? Open in Web Editor NEWAuto Create Gmail Accounts with popular names
Auto Create Gmail Accounts with popular names
$ python AutoCreateGmailAccount.py
Traceback (most recent call last):
File "AutoCreateGmailAccount.py", line 159, in
CGM = CreateGmail(UserInfoSeries)
TypeError: init() missing 3 required positional arguments: 'lastname', 'username', and 'pswd'
i use windows, but i cann't find user/local/bin
As the title says could you add a MIT license to this project? I would like to use the code you've written and try to make it work for the new Microsoft edge browser without any problems.
the panda is not setting up
and whenever the mobile verification window pop up the code stops
from selenium.webdriver.common.action_chains import ActionChains
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import pandas as pd
import random
import time
import sys
class CreateGmail:
"""Auto Create Gmail Accounts with popular names"""
def __init__(self, firstname, lastname, username, pswd):
self._firstname = firstname
self._lastname = lastname
self._username = username
self._pswd = pswd
self._Donefile = open("./data/CreatedAccounts.csv", "a")
self.Initialize()
def Initialize(self):
self._browser = webdriver.Chrome()
self._browser.delete_all_cookies()
self._browser.get("https://accounts.google.com/SignUp?hl=en")
def SetRecoveryEmail(self):
CreatedEmails = pd.read_csv("./data/CreatedAccounts.csv")["username"].values
if len(CreatedEmails) < 1:
self.recovery_email = "[email protected]"
else:
self.recovery_email = CreatedEmails[-1] + "@gmail.com"
def CreateAccount(self):
# self.SetRecoveryEmail()
self._browser.find_element_by_css_selector(r'input[id="firstName"]').send_keys(
self._firstname
)
time.sleep(1)
self._browser.find_element_by_css_selector(r'input[id="lastName"]').send_keys(
self._lastname
)
time.sleep(1)
self._browser.find_element_by_css_selector(r'input[id="username"]').send_keys(
self._username
)
time.sleep(1)
self._browser.find_element_by_css_selector(r'input[name="Passwd"]').send_keys(self._pswd)
time.sleep(3 + 3 * random.random())
self._browser.find_element_by_css_selector(r'input[name="ConfirmPasswd"]').send_keys(
self._pswd
)
self._browser.find_element_by_css_selector(r'div[id="accountDetailsNext"]').click()
self._browser.implicitly_wait(10)
self._browser.find_element_by_css_selector('#phoneNumberId').send_keys("900000000") #replace with your ph no
time.sleep(2)
self._browser.find_element_by_css_selector('#view_container > div > div > div.pwWryf.bxPAYd > div > div.zQJV3 > div > div.qhFLie > div > div > button > span').click()
time.sleep(15)
#self._browser.find_element_by_css_selector(r'div[id="view_container"]').click()
#self._browser.implicitly_wait(10)
#enter otp within 15 seconds and click on verify button all are automatic means what we do
self._browser.find_element_by_css_selector(
"#month > option:nth-child(%d)" % random.randint(1, 13)
).click()
self._browser.find_element_by_css_selector(r'#day').send_keys("25")
time.sleep(2)
self._browser.find_element_by_css_selector(r'#year').send_keys("1995")
time.sleep(9)
#Select Male Or Female which you needed that will not select automatically all are automatic means we are lazy so select
#and click next button ask for three times
#dropdown = Select(driver.find_element_by_name("gender"))
#dropdown.select_by_name("Male")
#self._browser.find_element_by_css_selector('#view_container > div > div > div.pwWryf.bxPAYd > div > div.zQJV3 > div > div.qhFLie > div > div > button > div.VfPpkd-RLmnJb').click()
#time.sleep(4)
#self._browser.find_element_by_css_selector('#view_container > div > div > div.pwWryf.bxPAYd > div > div.zQJV3 > div.dG5hZc > div.daaWTb > div > div > button > span').click()
#time.sleep(4)
#self._browser.find_element_by_css_selector('#view_container > div > div > div.pwWryf.bxPAYd > div > div.zQJV3 > div > div.qhFLie > div > div > button > div.VfPpkd-RLmnJb').click()
time.sleep(30)
@staticmethod
def GetUserInfo (firstnamefile, lastnamefile):
FirstName = pd.read_csv(firstnamefile).sample(frac=1)
LastName = pd.read_csv(lastnamefile).sample(frac=1)
num = min(len(FirstName), len(LastName))
if len(FirstName) > len(LastName):
UserInfo = LastName
UserInfo["firstname"] = FirstName.values[:num]
else:
UserInfo = FirstName
UserInfo["lastname"] = LastName.values[:num]
UserInfo.index = range(num)
UserInfo.dropna()
suffix = ""
for i in range(6):
suffix += str(random.randint(0, 9))
UserInfo["username"] = UserInfo["firstname"] + UserInfo["lastname"] + suffix
UserInfo["pswd"] = "super" + UserInfo["firstname"] + "233"
return UserInfo
def RunAppsScript(self, sharedlink):
"""So far, cannot auto totally
Open sharedlink and then, plz manually finish Install.
"""
self._browser.get(sharedlink)
time.sleep(10)
if name == "main":
SharedScript = "https://script.google.com/d/1yihwFAHrV17XHYmnrOJxQasqWGourSD57Xi-oFYO3sgY-B1_inPt5Vkc/edit?usp=sharing"
firstnamefile = "./data/CSV_Database_of_First_Names.csv"
lastnamefile = "./data/CSV_Database_of_Last_Names.csv"
UserInfoDF = CreateGmail.GetUserInfo(firstnamefile, lastnamefile)
for num in range(len(UserInfoDF)):
UserInfoSeries = UserInfoDF.loc[num]
CGM = CreateGmail(*UserInfoSeries)
CGM.CreateAccount()
# CGM.RunAppsScript(SharedScript)
time.sleep(10)
[17436:4064:0728/114002.197:ERROR:device_event_log_impl.cc(214)] [11:40:02.196] USB: usb_service_win.cc:415
Could not read device interface GUIDs: The system cannot find the file specified. (0x2)
[17436:4064:0728/114002.200:ERROR:device_event_log_impl.cc(214)] [11:40:02.200]
Bluetooth: bluetooth_adapter_winrt.cc:1074 Getting Default Adapter failed.
So, I've been trying to run the code but continuously getting code. I'm using windows 10 to run it. Please tell me how can i solve this issue.
File "C:\Users\qadee\OneDrive\Desktop\AutoCreateGmailAccount-master\AutoCreateGmailAccount.py", line 40, in CreateAccount
self._browser.find_element_by_css_selector(r'input[id="firstName"]').send_keys(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'WebDriver' object has no attribute 'find_element_by_css_selector'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.