Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 29 additions & 6 deletions gmail_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.chrome.service import Service as ChromeService
from selenium.webdriver.chrome.options import Options as ChromeOptions
from webdriver_manager.chrome import ChromeDriverManager
import random
import time
from datetime import datetime, timedelta
Expand All @@ -19,18 +20,27 @@

def main():

#proxy = ["ip:port", "ip:port"]#if you want to use a proxy, you can uncomment the next line and put your proxy list, I recommend using a socks5 proxy
#proxy = ["ip:port", "ip:port"] # Provide your proxy list if desired (see normalize_proxy for accepted formats)
# Here is a page that can provide you with free proxies: http://free-proxy.cz/en/proxylist/country/all/socks5/ping/all/2

# Chrome options
chrome_options = ChromeOptions()
chrome_options.add_argument("--disable-infobars")
#chrome_options.add_argument(f'--proxy-server=socks5://{random.choice(proxy)}') # if you want to use a socks5 proxy is for anonimous creation (highly recommended)
#chrome_options.add_argument('--ignore-certificate-errors') # if you use a proxy uncomment this line

# WebDriver service
ChromeService('chromedriver.exe')
driver = webdriver.Chrome(options=chrome_options)
# Configure proxy if provided
selected_proxy = None
try:
if proxy:
selected_proxy = normalize_proxy(random.choice(proxy))
chrome_options.add_argument(f'--proxy-server={selected_proxy}')
chrome_options.add_argument('--ignore-certificate-errors')
except NameError:
# proxy list not defined; continue without proxy
pass

# WebDriver service (Selenium Manager + webdriver-manager ensures a matching ChromeDriver)
service = ChromeService(executable_path=ChromeDriverManager().install())
driver = webdriver.Chrome(service=service, options=chrome_options)

#change the names to spanic ones down below you can see the list of french names
first_names = [
Expand Down Expand Up @@ -232,6 +242,19 @@ def fill_password(driver, wait, your_password):
next_button.click()
print("Password filled successfully")

#--------------------------------------------------------- proxy helpers -------------------------------------------------------------
def normalize_proxy(proxy_value, default_scheme="socks5"):
"""
Ensure the proxy string includes a scheme so Selenium/Chrome accept it.
If the scheme is missing, prepend default_scheme (socks5 by default).
"""
if not proxy_value:
return proxy_value
proxy_value = proxy_value.strip()
if "://" in proxy_value:
return proxy_value
return f"{default_scheme}://{proxy_value}"

#--------------------------------------------------------- extra functions -------------------------------------------------------------
def random_birthday(min_age=18, max_age=70):
today = datetime.today()
Expand Down
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This script allows you to automate the creation of Gmail accounts using the Sele

- Python 3.x
- ChromeDriver - [Download ChromeDriver](https://sites.google.com/chromium.org/driver/)
- Selenium library - Install using `pip install selenium`
- Python dependencies listed in `requirements.txt` (install with `pip install -r requirements.txt`)

## Usage

Expand All @@ -34,10 +34,10 @@ This script allows you to automate the creation of Gmail accounts using the Sele

2. Download the ChromeDriver executable and place it in the repository directory.

3. Install the required libraries:
3. Install the required libraries (this will install both `selenium` and `unidecode`):

```
pip install selenium
pip install -r requirements.txt
```

4. Open the script (`gmail_automation.py`) and update the `your_first_name`, `your_last_name`, `your_username`, `your_birthday`, `your_gender`, and `your_password` variables with your desired account details.
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
selenium
unidecode
unidecode
webdriver-manager