Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
root
committed
Jan 18, 2019
1 parent
a6d18e4
commit b5f2740
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import time, os | ||
from selenium import webdriver | ||
emailPath = "email.txt" | ||
passwordPath = "pass.txt" | ||
codePath = "code.txt" | ||
femail = open(emailPath, "r") | ||
email = femail.readline() | ||
fpass = open(passwordPath, "r") | ||
password = fpass.readline() | ||
driver = webdriver.Firefox() | ||
driver.get("https://www.gmail.com") | ||
driver.find_element_by_name("identifier").send_keys(email.split("\n")[0]) | ||
driver.find_element_by_id("identifierNext").click() | ||
time.sleep(1); | ||
driver.find_element_by_name("password").send_keys(password.split("\n")[0]) | ||
driver.find_element_by_id("passwordNext").click() | ||
while not os.path.exists(codePath): | ||
time.sleep(1) | ||
fcode = open(codePath, "r") | ||
code = fcode.readline() | ||
driver.find_element_by_name("idvPin").send_keys(code.split("\n")[0]) | ||
driver.find_element_by_id("idvPreregisteredPhoneNext").click() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
# script that runs as root | ||
# The display number must be a desktop session valid, you can view with echo $DISPLAY | ||
export PATH=$PATH:/bin/geckodriver | ||
DISPLAY=:1 python logingmail.py & |