Beispiel #1
0
  def build_chapters(self):
    logging.debug('building chapters for textbook "{}"'.format(self.name))
    soup = Base.soup_from_url(self.page)

    ul = soup.find('ul', {'class':'ulSumSbj'})

    chapters = []
    for li in ul.findAll('li', recursive=False):
      chapter = Chapter.from_tag(li)
      chapter.textbook = self
      chapters.append(chapter)

    self.chapters = chapters
Beispiel #2
0
  def build_topics(self):
    logging.debug('building topics for chapter "{}"'.format(self.name))
    soup = Base.soup_from_url(self.page)

    ul =  soup.find('ul', {'class':'sumObjUl'})

    lis = ul.findAll('li', recursive=False)
    uls = ul.findAll('ul', recursive=False)

    topics = []
    for index in range(0, len(lis)):
      topic = Topic.from_tags(lis[index],uls[index])
      topic.chapter = self
      topics.append(topic)

    self.topics = topics
Beispiel #3
0
 def build_tree(self):
   logging.debug('building tree')
   self.soup = Base.soup_from_url(Base.SITE_INDEX)
   self.sections = self.get_sections()