Skip to content

Commit

Permalink
[fix] 계절학기 이슈 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
rover0811 committed Dec 24, 2022
1 parent 95a16ac commit c14a60a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
7 changes: 6 additions & 1 deletion API/get_grade.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,12 @@ def click_drop_down(drop_down_selector, element_selector, ignored_exceptions=Non
if drop_down_button and element_button: break
try:
semester_drop_selector = 'input[role="combobox"][value$="학기"]'
first_semester_selector = f'div[class~="lsListbox__value"][data-itemkey="090"]'
first_semester_selector = 'div[class~="lsListbox__value"][data-itemkey="090"]'
second_semester_selector= 'div[class~="lsListbox__value"][data-itemkey="092"]'
# self.wait_table_updated()
#겨울학기 이슈
# second_semester_page_source=self.driver.page_source #2학기 성적은 변동이 필요없으므로 바로 받아온다.
click_drop_down(semester_drop_selector, second_semester_selector)
self.wait_table_updated()
second_semester_page_source=self.driver.page_source #2학기 성적은 변동이 필요없으므로 바로 받아온다.
click_drop_down(semester_drop_selector, first_semester_selector)
Expand Down
9 changes: 4 additions & 5 deletions API/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def read_root():
# return {"item_id": item_id, "q": q}

#uvicorn main:app --host=0.0.0.0 --port=8080
@app.post("/grade/")
@app.post("/grade/semester")
def get_token(item:Item):

login_url = "https://smartid.ssu.ac.kr/Symtra_sso/smln_pcs.asp"
Expand All @@ -55,7 +55,7 @@ def get_token(item:Item):

return grade

@app.post("/gradeTwo/")
@app.post("/grade/year")
def get_token(token:Key):

# login_url = "https://smartid.ssu.ac.kr/Symtra_sso/smln_pcs.asp"
Expand All @@ -76,8 +76,7 @@ def get_token(token:Key):
grade_first.extend(grade_second)


# sumbject_names = ['PHL', '융합전공을위한수학', '빅데이터프로그래밍언어',"프로그래밍및실습",'프로그래밍및실습']
sumbject_names = ['21507500', '21507501', '21500361',"21500364",'21500363']
subject_names = ['PHL', '융합전공을위한수학', '빅데이터프로그래밍언어',"프로그래밍및실습",'프로그래밍및실습']

grade_infos = [grade for grade in grade_first if grade['과목코드'] in sumbject_names]
grade_infos = [grade for grade in grade_first if grade['과목명'] in subject_names]
return grade_infos

0 comments on commit c14a60a

Please sign in to comment.