Skip to content

Commit

Permalink
* 修复一处由于知乎bug引发的bug - -
Browse files Browse the repository at this point in the history
  • Loading branch information
YaoZeyuan committed Dec 10, 2015
1 parent a82441c commit 91e283e
Show file tree
Hide file tree
Showing 3 changed files with 279 additions and 2,369 deletions.
4 changes: 3 additions & 1 deletion src/parser/content/simple_answer.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ def parse_href_info(self):
Debug.logger.debug(u'答案更新日期未找到')
return
href_tag = self.content.find('a', class_='answer-date-link')
if not href_tag:
if (not href_tag) and (self.body):
# 知乎站点有bug,会显示作者的匿名回答,导致self.body也可能为空
# 已向官方反馈
href_tag = self.body.find('a', class_='answer-date-link') # 再试一次
if not href_tag:
Debug.logger.debug(u'问题id,答案id未找到')
Expand Down
2 changes: 1 addition & 1 deletion unit/parser_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


is_info = 0
kind = 'collection' #直接在这里替换类别即可完成测试。可供测试的类别见字典键值
kind = 'author' #直接在这里替换类别即可完成测试。可供测试的类别见字典键值
unit ={
'answer':{
'src_answer':'./unit_html/single_answer.html',
Expand Down
Loading

0 comments on commit 91e283e

Please sign in to comment.