-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathadmit.py
56 lines (45 loc) · 1.59 KB
/
admit.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
54
55
56
import wget
def download(url, filename):
print("\n\ndownloading.....\n\n")
response = wget.download(url, filename)
print("\n\ncopy paste this link in browser if not downloaded\n\n")
print(url)
'''
from requests import get
def downloadasfile(url, filename):
with open(filename, "wb") as file :
print("\n\ndownloading.....\n\n")
response = get(url, stream = True)
file.write(response.content)
print("\n\ncopy paste this link in browser if not downloaded\n\n")
print(url)
'''
choice = 1
while choice :
print("Download single or multiple results?")
print("1. Single Admit Card\n2. Multiple Admit Card")
choice = int(input("3. Exit\n"))
if choice == 1 :
ccode = input("\n\nEnter college code :: ")
enum = input("\n\nEnter enrollment number:: ")
url = "https://bteup.ac.in/AdmitCardVerificationCard/AdmitCard/"+ccode+"/"+enum+".pdf"
filename = enum+".pdf"
download(url,filename)
if choice == 2 :
ccode = input("\n\nEnter college code :: ")
print("Enter range :: ")
lowenum = input("From this :: ")
upenum = input("To this :: ")
low = int(lowenum[1::])
up = int(upenum[1::])
up = up + 1
for i in range(low, up) :
enum = upenum[:1:]
i = f'{i}'
enum = enum + i
url = "https://bteup.ac.in/AdmitCardVerificationCard/AdmitCard/"+ccode+"/"+enum+".pdf"
filename = enum+".pdf"
download(url,filename)
else :
choice = 0
print("bye bye...:D")