本文整理汇总了Python中src.tools.match.Match.answer方法的典型用法代码示例。如果您正苦于以下问题:Python Match.answer方法的具体用法?Python Match.answer怎么用?Python Match.answer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类src.tools.match.Match
的用法示例。
在下文中一共展示了Match.answer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parse_answer
# 需要导入模块: from src.tools.match import Match [as 别名]
# 或者: from src.tools.match.Match import answer [as 别名]
def parse_answer(command):
result = Match.answer(command)
question_id = result.group('question_id')
answer_id = result.group('answer_id')
task = SingleTask()
task.kind = 'answer'
task.spider.href = 'https://www.zhihu.com/question/{}/answer/{}'.format(question_id, answer_id)
task.book.kind = 'answer'
task.book.sql.info = ' question_id = "{}" '.format(question_id)
task.book.sql.question = ' question_id = "{}" '.format(question_id)
task.book.sql.answer = ' question_id = "{}" and answer_id = "{}" '.format(question_id, answer_id)
return task