-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathresult.py
More file actions
68 lines (57 loc) · 2.51 KB
/
result.py
File metadata and controls
68 lines (57 loc) · 2.51 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# url = http://result.bteupexam.in/Odd_Semester/main/result.aspx?Roll_no=E1......
# url = http://result.bteupexam.in/Even_Semester/main/result.aspx?Roll_no=E1......
# from html2image import Html2Image
# hti = Html2Image()
# link = 'http://result.bteupexam.in/Odd_Semester/main/result.aspx?Roll_no=E1.......'
# hti.screenshot(url=link, save_as='test.png')
from html2image import Html2Image
def download(link, filename):
try :
print("\n\nDownloading.....{}\n\n".format(filename))
hti = Html2Image()
print(link)
print("\n\ncopy paste this link in browser if not downloaded\n\n")
hti.screenshot(url=link, save_as=filename)
print("{} downloaded successfully.....\n".format(filename))
except OSError :
print("\nUnfortunately failed to generate file. \nNot supported for your OS. \n")
print(link)
print("Copy paste this link in browser if not downloaded\n")
choice = 1
print("Not supported in Android for now\n")
while choice :
print("Download single or multiple results?")
print("1. Single Result\n2. Multiple Results")
choice = int(input("3. Exit\n"))
if choice == 1 :
print("\n\nFor Odd Even Semesters\n\n1. Odd semester choose 1\n2. Even Semester choose 2")
sem = int(input("Enter 1 or 2 :: "))
enum = input("\n\nEnter enrollment number:: ")
if sem == 1:
link = "http://result.bteupexam.in/Odd_Semester/main/result.aspx?Roll_no="+enum
if sem == 2:
link = "http://result.bteevaluation.co.in/even_test22testadc/main/oddresult.aspx?Roll_no="+enum
filename = enum+".png"
download(link,filename)
if choice == 2 :
print("Enter range :: ")
lowenum = input("From this :: ")
upenum = input("To this :: ")
low = int(lowenum[1::])
up = int(upenum[1::])
up = up + 1
print("\n\nFor Odd Even Semesters\n\n1. Odd semester choose 1\n2. Even Semester choose 2")
sem = int(input("Enter 1 or 2 :: "))
for i in range(low, up) :
enum = upenum[:1:]
i = f'{i}'
enum = enum + i
if sem == 1:
link = "http://result.bteupexam.in/Odd_Semester/main/result.aspx?Roll_no="+enum
if sem == 2:
link = "http://result.bteevaluation.co.in/even_test22testadc/main/oddresult.aspx?Roll_no="+enum
filename = enum+".png"
download(link,filename)
else :
choice = 0
print("bye bye...:D")