def answers(self):
        """获取话题下所有答案（按时间降序排列）

        :return: 话题下所有答案，返回生成器
        :rtype: Answer.Iterable
        """
        from .question import Question
        from .answer import Answer
        from .author import Author, ANONYMOUS

        newest_url = Topic_Newest_Url.format(self.id)
        params = {'start': 0, '_xsrf': self.xsrf}
        res = self._session.get(newest_url)
        soup = BeautifulSoup(res.content)
        while True:
            divs = soup.find_all('div', class_='folding')
            # 如果话题下无答案，则直接返回
            if len(divs) == 0:
                return
            last_score = divs[-1]['data-score']
            for div in divs:
                q = div.find('a', class_="question_link")
                question_url = Zhihu_URL + q['href']
                question_title = q.text.strip()
                question = Question(question_url, question_title,
                                    session=self._session)

                ans = div.find('a', class_='answer-date-link')
                answer_url = Zhihu_URL + ans['href']

                upvote = div.find('a', class_='zm-item-vote-count').text
                if upvote.isdigit():
                    upvote = int(upvote)
                else:
                    upvote = None

                au = div.find('div', class_='zm-item-answer-author-info')
                if au.a is None:
                    author = ANONYMOUS
                else:
                    author_url = Zhihu_URL + au.a['href']
                    author_name = au.a.text
                    author_motto = au.strong['title'] if au.strong else ''
                    author = Author(author_url, author_name, author_motto,
                                    session=self._session)
                yield Answer(answer_url, question, author, upvote,
                             session=self._session)

            params['offset'] = last_score
            res = self._session.post(newest_url, data=params)
            gotten_feed_num = res.json()['msg'][0]
            # 如果得到内容数量为0则返回
            if gotten_feed_num == 0:
                return
            soup = BeautifulSoup(res.json()['msg'][1])
def answers ( self ) : from . question import Question from . answer import Answer from . author import Author , ANONYMOUS newest_url = Topic_Newest_Url . format ( self . id ) params = { 'start' : 0 , '_xsrf' : self . xsrf } res = self . _session . get ( newest_url ) soup = BeautifulSoup ( res . content ) while True : divs = soup . find_all ( 'div' , class_ = 'folding' ) if len ( divs ) == 0 : return last_score = divs [ - 1 ] [ 'data-score' ] for div in divs : q = div . find ( 'a' , class_ = "question_link" ) question_url = Zhihu_URL + q [ 'href' ] question_title = q . text . strip ( ) question = Question ( question_url , question_title , session = self . _session ) ans = div . find ( 'a' , class_ = 'answer-date-link' ) answer_url = Zhihu_URL + ans [ 'href' ] upvote = div . find ( 'a' , class_ = 'zm-item-vote-count' ) . text if upvote . isdigit ( ) : upvote = int ( upvote ) else : upvote = None au = div . find ( 'div' , class_ = 'zm-item-answer-author-info' ) if au . a is None : author = ANONYMOUS else : author_url = Zhihu_URL + au . a [ 'href' ] author_name = au . a . text author_motto = au . strong [ 'title' ] if au . strong else '' author = Author ( author_url , author_name , author_motto , session = self . _session ) yield Answer ( answer_url , question , author , upvote , session = self . _session ) params [ 'offset' ] = last_score res = self . _session . post ( newest_url , data = params ) gotten_feed_num = res . json ( ) [ 'msg' ] [ 0 ] if gotten_feed_num == 0 : return soup = BeautifulSoup ( res . json ( ) [ 'msg' ] [ 1 ] )
获取话题下所有答案（按时间降序排列）

        :return: 话题下所有答案，返回生成器
        :rtype: Answer.Iterable