forked from shradhaN/SMS-Alert
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meetalert.py
41 lines (32 loc) · 1.15 KB
/
meetalert.py
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
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from config import accounts
import time
#Message
message = raw_input("message")
#phone numbers of club members
group1 = accounts[0]['group']
group2 = accounts[1]['group']
#Login
def login(username,password,group):
driver = webdriver.Firefox()
driver.get("http://www.meet.net.np/meet/")
driver.find_element_by_class_name("elgg-input-text").send_keys(username)
driver.find_element_by_class_name("elgg-input-password").send_keys(password)
driver.find_element_by_id("loginImage").click()
time.sleep(1)
#Send Message
driver.get("http://www.meet.net.np/meet/sms/sms")
driver.find_element_by_name("sendsmsbutton").click()
time.sleep(1)
driver.find_element_by_name("recipient").send_keys(group)
driver.find_element_by_id("message").send_keys(message)
driver.find_element_by_name("sendbutton").click()
#close the browser
time.sleep(1)
driver.quit()
login(accounts[0]['username'], accounts[0]['password'], group1)
time.sleep(1)
# Reopen the browser with new username and password
login(accounts[1]['username'], accounts[1]['password'], group2)