From c14a60a7adb70dba1eea5d0ff8d5b98e43cf5dd4 Mon Sep 17 00:00:00 2001 From: rover0811 Date: Sat, 24 Dec 2022 23:45:57 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EA=B3=84=EC=A0=88=ED=95=99=EA=B8=B0=20?= =?UTF-8?q?=EC=9D=B4=EC=8A=88=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- API/get_grade.py | 7 ++++++- API/main.py | 9 ++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/API/get_grade.py b/API/get_grade.py index 175ae8e..de98b09 100644 --- a/API/get_grade.py +++ b/API/get_grade.py @@ -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) diff --git a/API/main.py b/API/main.py index a395d41..6d8d8cd 100644 --- a/API/main.py +++ b/API/main.py @@ -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" @@ -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" @@ -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 \ No newline at end of file