Nobelz / RateMyProfessorAPI

Python web scraper to get professor ratings from ratemyprofessor.com website.
Apache License 2.0
39 stars 11 forks source link

Possible Website Update: AttributeError: 'NoneType' object has no attribute 'id' #18

Closed d-parkin closed 1 year ago

d-parkin commented 1 year ago

I was using this tool with no issues about four days ago. Now I get the same AttributeError as mentioned before in Issues. I suspect it is because the RateMyProfessor website has been updated once again. Below is the error:


Traceback (most recent call last):
  File "c:\rmpScrape.py", line 6, in <module>
    professor = ratemyprofessor.get_professor_by_school_and_name(
  File "C:\Python310\lib\site-packages\ratemyprofessor\__init__.py", line 80, in get_professor_by_school_and_name
    professors = get_professors_by_school_and_name(college, professor_name)
  File "C:\Python310\lib\site-packages\ratemyprofessor\__init__.py", line 104, in get_professors_by_school_and_name
    url = 'https://www.ratemyprofessors.com/search/professors/%s?q=%s' % (college.id, professor_name)
AttributeError: 'NoneType' object has no attribute 'id'

And my code:

professor = ratemyprofessor.get_professor_by_school_and_name(
    ratemyprofessor.get_school_by_name("California State University Long Beach"), professor_name)
d-parkin commented 1 year ago

I believe the issue has been fixed perhaps the website reverted back.