-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
36 lines (28 loc) · 1.09 KB
/
main.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
import sys
import datetime
from login import *
from keepstreak import *
from selenium import webdriver
from selenium.webdriver.firefox.service import Service
from webdriver_manager.firefox import GeckoDriverManager
def main():
firefox_options = webdriver.FirefoxOptions()
firefox_options.headless = True
firefox_options.set_preference("media.volume_scale", "0.0")
firefox_options.set_preference("dom.push.enabled", False)
driver = webdriver.Firefox(service=Service(GeckoDriverManager(path=os.getcwd()).install(), log_path=os.devnull), options=firefox_options)
driver.implicitly_wait(10)
os.system("cls" if sys.platform == "win32" else "clear")
with open("tryhackmebot.log", 'a') as f:
print("[+] Starting...")
date = datetime.datetime.now().strftime("%d-%m-%Y, %H:%M:%S")
f.write(f"{date}\n")
f.write("[+] Starting...\n")
login_form(driver)
keep_streak(driver)
with open("tryhackmebot.log", 'a') as f:
print("[+] Closing...")
f.write("[+] Closing...\n\n")
driver.quit()
if __name__ == "__main__":
main()