-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
50 lines (46 loc) · 1.1 KB
/
main.py
File metadata and controls
50 lines (46 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import webbrowser, pyautogui
import time, os
from bs4 import BeautifulSoup
import requests
from selenium import webdriver
# print(dir(os.path))
file = os.path.join(os.path.dirname(os.getcwd()),'index.txt')
url_1 = 'www.gmail.com'
url_2 = 'www.google.com'
pwd = None
email = None
class mailConnect:
def __init__(self):
# self.url = 'www.gmail.com'
self.open = False
self.moveX = 1344/2
self.moveY = 744/2
def passwd(self,pwd):
time.sleep(4)
pyautogui.typewrite(f'{pwd}\n', interval=.2)
return
def mail(self, email):
pyautogui.click(x=self.moveX, y=self.moveY)
pyautogui.typewrite(f'{email}\n', interval=.2)
# time.sleep(5)
return True
def valid_url(self):
# if webbrowser.get('windows-default').open_new_tab(self.url) == False:
return True
def open_tab(self,url):
webbrowser.open_new_tab(url)
time.sleep(7)
return True
def close_tab(self):
return
conn = mailConnect()
d =[ x for x in open(file, 'r') ]
start = True
if start:
conn.open_tab(url_1)
conn.mail(d[0])
conn.passwd(d[1])
conn.open_tab(url_2)
#browser= webdriver.Chrome()
#Refreshes the web page
# browser.refresh()