Skip to content

Commit

Permalink
fix commas in subject names
Browse files Browse the repository at this point in the history
  • Loading branch information
vishruthdevan committed Jul 7, 2022
1 parent 59c5744 commit dda0b3b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
8 changes: 4 additions & 4 deletions course_lists/2020_batch/cse_bds.csv
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ BCT3004,BCT3004 - Privacy and Security in Internet of Things,C1+TC1,SJT315,BAIJU
BCT3004,BCT3004 - Privacy and Security in Internet of Things,C2+TC2,SJT603,BAIJU B V,ETH
BCT4003,BCT4003 - Wearable Computing,E1+TE1,NIL,JAFAR ALI IBRAHIM S,EPJ
BCT4003,BCT4003 - Wearable Computing,E1+TE1,SJT709,JAFAR ALI IBRAHIM S,ETH
BIT1026,BIT1026 - Food, Nutrition and Health,A2+TA2,SMV217,SURESH P.K,TH
BIT1026,BIT1026 - Food, Nutrition and Health,B2+TB2,MB225,RAHUL VASHISHTH,TH
BIT1026,BIT1026 - Food, Nutrition and Health,E1+TE1,SMV214,SURESH P.K,TH
BIT1026,"BIT1026 - Food, Nutrition and Health",A2+TA2,SMV217,SURESH P.K,TH
BIT1026,"BIT1026 - Food, Nutrition and Health",B2+TB2,MB225,RAHUL VASHISHTH,TH
BIT1026,"BIT1026 - Food, Nutrition and Health",E1+TE1,SMV214,SURESH P.K,TH
BIT1904,BIT1904 - Capstone Project,NIL,NIL,ACADEMICS,PJT
BIT1904,BIT1904 - Capstone Project,NIL,NIL,PLACEMENT AND TRAINING,PJT
BIT4099,BIT4099 - Capstone Project,NIL,NIL,ACADEMICS,PJT
Expand Down Expand Up @@ -765,7 +765,7 @@ MEE4099,MEE4099 - Capstone Project,NIL,NIL,ACADEMICS,PJT
MEE4099,MEE4099 - Capstone Project,NIL,NIL,PLACEMENT AND TRAINING,PJT
MEE6099,MEE6099 - Masters Thesis,NIL,NIL,ACADEMICS,PJT
MEE6099,MEE6099 - Masters Thesis,NIL,NIL,PLACEMENT AND TRAINING,PJT
SET5003,SET5003 - Science, Engineering and Technology Project - III,NIL,NIL,ACADEMICS,PJT
SET5003,SET5003 - Science, Engineering and Technology Project - III,NIL,ACADEMICS,PJT
CSE3013,CSE3013 - Artificial Intelligence,E1+TE1,NIL,MOHANA CM,EPJ
CSE3013,CSE3013 - Artificial Intelligence,E1+TE1,NIL,SANTHI K,EPJ
CSE3013,CSE3013 - Artificial Intelligence,E1+TE1,NIL,SRIDHAR RAJ S,EPJ
Expand Down
8 changes: 4 additions & 4 deletions course_lists/2020_batch/cse_core.csv
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,9 @@ BCT3004,BCT3004 - Privacy and Security in Internet of Things,C1+TC1,SJT315,BAIJU
BCT3004,BCT3004 - Privacy and Security in Internet of Things,C2+TC2,SJT603,BAIJU B V,ETH
BCT4003,BCT4003 - Wearable Computing,E1+TE1,NIL,JAFAR ALI IBRAHIM S,EPJ
BCT4003,BCT4003 - Wearable Computing,E1+TE1,SJT709,JAFAR ALI IBRAHIM S,ETH
BIT1026,BIT1026 - Food, Nutrition and Health,A2+TA2,SMV217,SURESH P.K,TH
BIT1026,BIT1026 - Food, Nutrition and Health,B2+TB2,MB225,RAHUL VASHISHTH,TH
BIT1026,BIT1026 - Food, Nutrition and Health,E1+TE1,SMV214,SURESH P.K,TH
BIT1026,"BIT1026 - Food, Nutrition and Health",A2+TA2,SMV217,SURESH P.K,TH
BIT1026,"BIT1026 - Food, Nutrition and Health",B2+TB2,MB225,RAHUL VASHISHTH,TH
BIT1026,"BIT1026 - Food, Nutrition and Health",E1+TE1,SMV214,SURESH P.K,TH
BIT1904,BIT1904 - Capstone Project,NIL,NIL,ACADEMICS,PJT
BIT1904,BIT1904 - Capstone Project,NIL,NIL,PLACEMENT AND TRAINING,PJT
BIT4099,BIT4099 - Capstone Project,NIL,NIL,ACADEMICS,PJT
Expand Down Expand Up @@ -779,6 +779,6 @@ MEE4099,MEE4099 - Capstone Project,NIL,NIL,ACADEMICS,PJT
MEE4099,MEE4099 - Capstone Project,NIL,NIL,PLACEMENT AND TRAINING,PJT
MEE6099,MEE6099 - Masters Thesis,NIL,NIL,ACADEMICS,PJT
MEE6099,MEE6099 - Masters Thesis,NIL,NIL,PLACEMENT AND TRAINING,PJT
SET5003,SET5003 - Science, Engineering and Technology Project - III,NIL,NIL,ACADEMICS,PJT
SET5003,SET5003 - Science, Engineering and Technology Project - III,NIL,ACADEMICS,PJT
ENG1000,ENG1000 - Foundation English - I,L11+L12+L27+L28,TT432,SRINIVASAN R,LO
ENG2000,ENG2000 - Foundation English - II,L33+L34+L47+L48,SJT721,SANKAR G,LO
15 changes: 9 additions & 6 deletions scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import requests
from bs4 import BeautifulSoup

# courses = ["CSE3001", "CSE2006"] # add list of courses required
# courses = ["CSE3001", "CSE2006"] # add list of courses required
courses = []

config = {
Expand Down Expand Up @@ -77,18 +77,21 @@
url = "https://vtop.vit.ac.in/vtop/academics/common/getCoursesDetailForRegistration"

for j in range(len(courses)):

# print(f"\n{j}:\n")
payload["courseCode"] = courses[j]
r = requests.post(url, data=payload, headers=headers)
soup = BeautifulSoup(r.text, "html.parser")
s = soup.select("#courseDetailFragement > div > table > tr > td > span")

for i in range(0, len(s), 4):
#write to csv
# write to csv
with open("courses.csv", "a") as f:
if subject_name == "":
f.write(f"{courses[j]},{s[i].text},{s[i+1].text},{s[i+2].text},{s[i+3].text}\n")
f.write(
f"{courses[j]},{s[i].text},{s[i+1].text},{s[i+2].text},{s[i+3].text}\n"
)
else:
f.write(f"{courses[j]},{subject_name[j]},{s[i].text},{s[i+1].text},{s[i+2].text},{s[i+3].text}\n")

f.write(
f'{courses[j]},"{subject_name[j]}",{s[i].text},{s[i+1].text},{s[i+2].text},{s[i+3].text}\n'
)

1 comment on commit dda0b3b

@z404
Copy link
Contributor

@z404 z404 commented on dda0b3b Jul 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol i saw these and they were messing up the sheet so i just deleted the entries in the sheet xD

Please sign in to comment.