-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscrape_it.py
47 lines (42 loc) · 1.13 KB
/
scrape_it.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
#!/usr/bin/env python3
from scraper import ResultScraper as RS
from argparse import ArgumentParser
from getpass import getpass
def main():
"""main method"""
parser = ArgumentParser(
description='Fetch Student Results using Delta\'s server'
)
parser.add_argument(
"-r",
"--roll_number",
dest="uname",
help="NITT Rollnumber",
type=str,
required=True
)
parser.add_argument(
"-s",
"--save_result",
dest="save_d",
help="Save result to text file",
action="store_true",
required=False
)
args = parser.parse_args()
if args.uname is None:
print("Please enter roll number")
else:
password = getpass(prompt="Webmail or Octa Password: ")
if password is None:
print("Please enter roll number and password again")
else:
data = dict()
data["uname"] = args.uname
data["pwd"] = password
rCls = RS(data)
rCls.print_results()
if args.save_d:
rCls.save_to_file()
if __name__ == "__main__":
main()