Skip to content

Commit

Permalink
Merge pull request #32 from ThilakReddyy/develop
Browse files Browse the repository at this point in the history
Added marks
  • Loading branch information
ThilakReddyy committed Jul 3, 2023
2 parents 2d3e0c3 + 7e7e7c2 commit 38453c7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion jntuhresults/Executables/jntuhresultscraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,20 @@ def scrape_results(self, semester_code, response):
subject_name_index = Results_column_names.index("SUBJECT NAME")
subject_code_index = Results_column_names.index("SUBJECT CODE")
subject_credits_index = Results_column_names.index("CREDITS(C)")
subject_internal_marks_index = Results_column_names.index("INTERNAL")
subject_external_marks_index = Results_column_names.index("EXTERNAL")
subject_total_marks_index = Results_column_names.index("TOTAL")



Results = Results[1:]
for result_subject in Results:
subject_name = result_subject.find_all("td")[subject_name_index].get_text()
subject_code = result_subject.find_all("td")[subject_code_index].get_text()
subject_grade = result_subject.find_all("td")[grade_index].get_text()
subject_internal_marks = result_subject.find_all("td")[subject_internal_marks_index].get_text()
subject_external_marks = result_subject.find_all("td")[subject_external_marks_index].get_text()
subject_total_marks = result_subject.find_all("td")[subject_total_marks_index].get_text()
subject_credits = result_subject.find_all("td")[
subject_credits_index
].get_text()
Expand All @@ -161,6 +169,9 @@ def scrape_results(self, semester_code, response):
self.results["Results"][semester_code][subject_code] = {}
self.results["Results"][semester_code][subject_code]["subject_code"] = subject_code
self.results["Results"][semester_code][subject_code]["subject_name"] = subject_name
self.results["Results"][semester_code][subject_code]["subject_internal"]=subject_internal_marks
self.results["Results"][semester_code][subject_code]["subject_external"]=subject_external_marks
self.results["Results"][semester_code][subject_code]["subject_total"]=subject_total_marks
self.results["Results"][semester_code][subject_code]["subject_grade"] = subject_grade
self.results["Results"][semester_code][subject_code][
"subject_credits"
Expand Down Expand Up @@ -255,7 +266,7 @@ async def scrape_all_results(self, exam_code="all"):


def run(self):
timeout = 3.5 # Timeout value in seconds
timeout = 4 # Timeout value in seconds
try:
return asyncio.run(asyncio.wait_for(self.scrape_all_results(), timeout))
except asyncio.TimeoutError:
Expand Down

0 comments on commit 38453c7

Please sign in to comment.