'Returns `True` if course for given org, number and run exists on the page otherwise `False`'

def has_course(self, org, number, run, archived=False):

    for course in self.list_courses(archived):
        if ((course['org'] == org) and (course['number'] == number) and (course['run'] == run)):
            return True
    return False
