Skip to content

Commit

Permalink
Added debug statements
Browse files Browse the repository at this point in the history
  • Loading branch information
meezlung committed Dec 19, 2024
1 parent 2ed3952 commit 7fc2db9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crs_scraper/optimized_crscraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,17 @@ def access_all_possible_course_schedules(self) -> None:

if table:
for row in table.find_all("tr")[1:]:
no_matching = row.get_text(separator="\n", strip=True)
print(no_matching)

if no_matching == "No matching results":
raise ValueError("No matching results found or invalid course URL")

cells = row.find_all("td")
if cells:
self.append_sorted_row_data(cells)
else:
raise ValueError("No course URLs provided")
return None

def append_sorted_row_data(self, cells: list[Tag]) -> None:
course, section = self.extract_course_and_section(cells[1].get_text(separator="\n", strip=True).split('\n'))
Expand Down

0 comments on commit 7fc2db9

Please sign in to comment.