def generate(self, student_id):
        # This is the URL where the source of schedule come from.
        course_table_url = self.__get_url() + "/StudentQuery/CtrlViewQueryCourseTable"
        # Create the request to get the raw data of schedule.
        request = Request(url=course_table_url, data=urlencode({'studentNo': student_id}).encode('utf-8'))

        # Get and return the raw data.
        data = self.__opener.open(request).read().decode('utf-8')

        # First extract data from HTML.
        initial_data = re.findall(pattern=r"<tr>(.+?)</tr>", string=data, flags=re.S)

        # Create a list of a list of course info.
        course_list = []
        for extracted_data in initial_data:
            items = re.findall(pattern=r"<td>(.*?)</td>", string=extracted_data, flags=re.S)
            course_items = [item.strip() for item in items]

            if len(course_items) != 11:
                continue

            course = Course(course_items[2],
                            course_items[6],
                            course_items[4],
                            course_items[1],
                            course_items[5],
                            course_items[7],
                            course_items[9],
                            course_items[10])
            course_list.append(course)

        events = []
        for course in course_list:
            events += course.get_events(self.__weekday_table, self.__course_time_table)

        cal = Calendar()
        cal.add("calscale", "GREGORIAN")
        cal.add("version", "2.0")
        cal.add("X-WR-CALNAME", "SHU Course Schedule")
        cal.add("X-WR-TIMEZONE", "Asia/Shanghai")

        for event in events:
            cal.add_component(event)

        cal_path = os.path.join(os.getcwd(), "Course Schedule.ics")
        f = open(cal_path, "wb")
        f.write(cal.to_ical())
        f.close()
        cros_platopen(cal_path)