-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUI_Khamsat.py
53 lines (51 loc) · 1.57 KB
/
UI_Khamsat.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
42
43
44
45
46
47
48
49
50
51
52
53
#import the files
import time
from selenium import webdriver
from tkinter import *
from tkinter import ttk
#create the form
root=Tk()
root.title('خمسات')
a=ttk.Button(root,text='بدء')
a.pack()
b=ttk.Button(root,text='ايقاف')
b.pack()
style = ttk.Style()
style.theme_use('alt')
style.configure('TButton',background='Green',font=('Arial',50,'bold'),foreground='white')
#include the webdriver file
driver = webdriver.Chrome('chromedriver.exe');
#go to the login link
driver.get("https://accounts.hsoub.com/login?source=khamsat&locale=ar");
#set the email;
email = driver.find_element_by_name('email');
email.send_keys('[email protected]');#You have to change
#set the password
password = driver.find_element_by_name('password');
password.send_keys('myfuckingpassword');#You have to change
#send enter
password.submit();
#get the home page
time.sleep(2)
driver.get("https://khamsat.com");
#click on login button
time.sleep(2)
driver.execute_script("$('.fa-sign-in').click();");
time.sleep(2)
file = open("gigs.txt","r")
gigs = file.readlines()
#the order function
def what(x):
for line in gigs:
driver.get(line);
time.sleep(2)
if x == 1:
driver.execute_script(' $("[value=\'true\']").attr("selected","selected"); ');#to start
elif x == 2:
driver.execute_script(' $("[value=\'false\']").attr("selected","selected"); ');#to stop
driver.execute_script(' $(\'button:contains("تحديث")\').click(); ');
time.sleep(2)
#the UI loop
a.config(command=lambda : what(1))
b.config(command=lambda : what(2))
root.mainloop()