Skip to content

Commit

Permalink
Merge branch 'martig7/issue801' of https://github.com/YACS-RCOS/yacs.n
Browse files Browse the repository at this point in the history
…into martig7/issue801
  • Loading branch information
bnavac committed Oct 9, 2023
2 parents c002074 + 2daa11b commit 6132751
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
21 changes: 15 additions & 6 deletions rpi_data/modules/new_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
def login(driver):
URL = "http://sis.rpi.edu"
driver.get(URL)
driver.implicitly_wait(2)
driver.implicitly_wait(.5)
username_box = driver.find_element(by=By.NAME, value = "j_username")
password_box = driver.find_element(by=By.NAME, value = "j_password")
submit = driver.find_element(by=By.NAME, value = "_eventId_proceed")
Expand Down Expand Up @@ -53,8 +53,8 @@ def sisCourseSearch(driver, term):
url = "https://sis.rpi.edu/rss/bwskfcls.p_sel_crse_search"
driver.get(url)
select = Select(driver.find_element(by=By.ID, value = "term_input_id"))
basevalue = 200000
while True:
basevalue = 200000 #this number will represent the term we are looking at
while True: #this will add the term code to the last digit, making sure that the term exists
try:
if ("spring" in term):
basevalue += 1
Expand All @@ -68,16 +68,17 @@ def sisCourseSearch(driver, term):
term = input("Your term may be incorrect, enter the correct term here:")
else:
break
year = int(term[-2])*10 + int(term[-1])
basevalue += year * 100
year = int(term[-2])*10 + int(term[-1]) #this is the last two digits of the year TODO:
basevalue += year * 100 #this makes the basevalue show our year
select.select_by_value(str(basevalue))
driver.find_element(by = By.XPATH, value = "/html/body/div[3]/form/input[2]").click()
subject_select = Select(driver.find_element(by=By.XPATH, value = '//*[@id="subj_id"]'))
subjects = subject_select.options
for i in range(len(subjects)):
subject_select.select_by_index(i)
driver.find_element(by = By.NAME, value = 'SUB_BTN').click()
parseCourseTable(driver)
parseCourseTable(driver) #TODO: replace with parser for first part of csv (probably getCoursesInMajor())
parseReqsAndDesc(driver, basevalue) #TODO: make sure this goes in the right place, probably in getCoursesInMajor
driver.get(url)
select = Select(driver.find_element(by=By.ID, value = "term_input_id"))
select.select_by_value(str(basevalue))
Expand All @@ -88,6 +89,14 @@ def parseCourseTable(driver):
html = driver.page_source
time.sleep(20)

def parseReqsAndDesc(driver, basevalue): #needs to return a list
url = 'https://sis.rpi.edu/rss/bwckctlg.p_display_courses?term_in=' + str(basevalue) +'&call_proc_in=&sel_subj=&sel_levl=&sel_schd=&sel_coll=&sel_divs=&sel_dept=&sel_attr=&sel_subj=' #subject code needs to be appended to end before go
subj_codes = ['ADMN','ARCH', 'ARTS'] #TODO: finish listing these... by hand...
schools = [] #TODO: also probably do this.. by hand..
driver.get(url)
info = list() #[Short-Name, Full-Name, Description, raw pre/coreq text, prereq, coreq, School]




#Given a semester and a major, get the pre and coreqs for every class in that major
Expand Down
2 changes: 1 addition & 1 deletion rpi_data/summer-2023.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PRIVATE MUSIC LESSONS: FLUTE,,1,,,,Gerbino/Fisher-Loc,,6,0,6,ARTS,2023-05-22,202
PRIVATE MUSIC LESSONS: OBOE,,1,,,,Gerbino/Fisher-Loc,,6,0,6,ARTS,2023-05-22,2023-08-18,SUMMER 2023,18421,2750,04,ARTS-2750,Private Music Lessons,,,,[],[],"Humanities, Arts and Social Sciences"
PRIVATE MUSIC LESSONS:CLARINET,,1,,,,Gerbino/Fisher-Loc,,6,0,6,ARTS,2023-05-22,2023-08-18,SUMMER 2023,18422,2750,05,ARTS-2750,Private Music Lessons,,,,[],[],"Humanities, Arts and Social Sciences"
PRIVATE MUSIC LESSONS: SAX,,1,,,,Gerbino/Fisher-Loc,,6,0,6,ARTS,2023-05-22,2023-08-18,SUMMER 2023,18423,2750,06,ARTS-2750,Private Music Lessons,,,,[],[],"Humanities, Arts and Social Sciences"
PRIVATE MUSIC LESSONS: VOICE,,1,,,,Harrigan/Skovira/Fish,,12,1,11,ARTS,2023-05-22,2023-08-18,SUMMER 2023,18424,2750,07,ARTS-2750,Private Music Lessons,,,,[],[],"Humanities, Arts and Social Sciences"
PRIVATE MUSIC LESSONS: VOICE,,1,,,,Harrigan/Skovira/Fish,,12,1,11,ARTS,2023-05-22,2023-08-18,SUMMER 2023,18424,2750,07,ARTS-2750,Private Music Lessons,,,,[],[],"Humanities, Arts and Social Sciences"
PRIVATE MUSIC LESSONS: GUITAR,,1,,,,Quigley/Fisher-Loc,,12,2,10,ARTS,2023-05-22,2023-08-18,SUMMER 2023,18493,2750,08,ARTS-2750,Private Music Lessons,,,,[],[],"Humanities, Arts and Social Sciences"
PRIVATE MUSIC LESSONS: CELLO,LEC,1,,,,Bebe,,10,0,10,ARTS,2023-05-22,2023-08-18,SUMMER 2023,18668,2750,09,ARTS-2750,Private Music Lessons,,,,[],[],"Humanities, Arts and Social Sciences"
PRIVATE MUSIC LESSONS: PIANO,LEC,1,,,,Tu,,6,1,5,ARTS,2023-05-22,2023-08-18,SUMMER 2023,18669,2750,10,ARTS-2750,Private Music Lessons,,,,[],[],"Humanities, Arts and Social Sciences"
Expand Down

0 comments on commit 6132751

Please sign in to comment.