YaoZeyuan / ZhihuHelp_archived

(停止维护)快速将知乎内容转换为epub电子书, 请移步https://github.com/YaoZeyuan/zhihuhelp_with_node
426 stars 134 forks source link

知乎用户主页结构变化,爬取指定用户的所有答案失败 #78

Closed knarfeh closed 7 years ago

knarfeh commented 8 years ago

报错信息:

Traceback (most recent call last):
  File "zhihuHelp.py", line 16, in <module>
    helper.start()
  File "/Users/Frank/workshop/ZhihuHelp/src/main.py", line 57, in start
    self.create_book(line, counter)  # 一行内容代表一本电子书
  File "/Users/Frank/workshop/ZhihuHelp/src/main.py", line 81, in create_book
    book = Book(task_package.book_list)
  File "/Users/Frank/workshop/ZhihuHelp/src/book.py", line 21, in __init__
    raw_book_list = [book.catch_data() for book in self.flatten(raw_sql_book_list)]
  File "/Users/Frank/workshop/ZhihuHelp/src/container/initialbook.py", line 49, in catch_data
    self.get_article_list()
  File "/Users/Frank/workshop/ZhihuHelp/src/container/initialbook.py", line 112, in get_article_list
    article_list = self.__get_question_list()
  File "/Users/Frank/workshop/ZhihuHelp/src/container/initialbook.py", line 141, in __get_question_list
    question_list = [add_property(x) for x in merge_answer_into_question() if len(x['answer_list'])]
  File "/Users/Frank/workshop/ZhihuHelp/src/container/initialbook.py", line 124, in merge_answer_into_question
    question_dict[answer['question_id']]['answer_list'].append(answer)
KeyError: 0
YaoZeyuan commented 7 years ago

终于改完了 😂