sdu_bkjws/__init__.py
def get_lesson(self):
        """
        获取课表,返回一个列表,包含所有课表对象

        :return: list of lessons
        :rtype: list[dict]
        """
        html = self._get('http://bkjws.sdu.edu.cn/f/xk/xs/bxqkb')
        soup = BeautifulSoup(html, "html.parser")
        s = soup.find('table',
                      attrs={"class": "table table-striped table-bordered table-hover",
                             "id": "ysjddDataTableId"})
        tr_box = s.find_all('tr')
        c = list()

        for les in tr_box[1:]:
            td_box = les.find_all('td')
            c.append({"lesson_num_long": td_box[1].text,
                      "lesson_name": td_box[2].text,
                      "lesson_num_short": td_box[3].text,
                      "credit": td_box[4].text,
                      "school": td_box[6].text,
                      "teacher": td_box[7].text,
                      "weeks": td_box[8].text,
                      "days": td_box[9].text,
                      "times": td_box[10].text,
                      "place": td_box[11].text})
        self._lessons = c
        return c
def get_lesson(self):
        """
        获取课表,返回一个列表,包含所有课表对象

        :return: list of lessons
        :rtype: list[dict]
        """
        html = self._get('http://bkjws.sdu.edu.cn/f/xk/xs/bxqkb')
        soup = BeautifulSoup(html, "html.parser")
        s = soup.find('table',
                      attrs={"class": "table table-striped table-bordered table-hover",
                             "id": "ysjddDataTableId"})
        tr_box = s.find_all('tr')
        c = list()

        for les in tr_box[1:]:
            td_box = les.find_all('td')
            c.append({"lesson_num_long": td_box[1].text,
                      "lesson_name": td_box[2].text,
                      "lesson_num_short": td_box[3].text,
                      "credit": td_box[4].text,
                      "school": td_box[6].text,
                      "teacher": td_box[7].text,
                      "weeks": td_box[8].text,
                      "days": td_box[9].text,
                      "times": td_box[10].text,
                      "place": td_box[11].text})
        self._lessons = c
        return c
def get_lesson ( self ) : html = self . _get ( 'http://bkjws.sdu.edu.cn/f/xk/xs/bxqkb' ) soup = BeautifulSoup ( html , "html.parser" ) s = soup . find ( 'table' , attrs = { "class" : "table table-striped table-bordered table-hover" , "id" : "ysjddDataTableId" } ) tr_box = s . find_all ( 'tr' ) c = list ( ) for les in tr_box [ 1 : ] : td_box = les . find_all ( 'td' ) c . append ( { "lesson_num_long" : td_box [ 1 ] . text , "lesson_name" : td_box [ 2 ] . text , "lesson_num_short" : td_box [ 3 ] . text , "credit" : td_box [ 4 ] . text , "school" : td_box [ 6 ] . text , "teacher" : td_box [ 7 ] . text , "weeks" : td_box [ 8 ] . text , "days" : td_box [ 9 ] . text , "times" : td_box [ 10 ] . text , "place" : td_box [ 11 ] . text } ) self . _lessons = c return c
获取课表,返回一个列表,包含所有课表对象

        :return: list of lessons
        :rtype: list[dict]
获取课表 返回一个列表 包含所有课表对象