pittcsc / PittAPI

An API to easily get data from the University of Pittsburgh
https://pittapi.pittcsc.org
GNU General Public License v2.0
105 stars 30 forks source link

IndexError when getting extra details for section #108

Closed maxdudek closed 5 years ago

maxdudek commented 5 years ago

The function at line 230 of course.py could throw an IndexError if the parameter text does not contain the string ' :'

The function should look like:

def __extract_data_past_colon(text: str) -> str:
        if ': ' in text:
            return text.split(': ')[1]
        else:
            return text

I was getting this issue for some reason and this fixed it

azharichenko commented 5 years ago

So the issue is to do with scraping through multiple class attributes, for what it seems. I'd don't believe that is the full solution, but was on the right track. I'm currently investigating it.