sql="""select id, content, created_time, comment_count from zhihu_answer"""
self.cur.execute(sql)
topics=[]
tuple=self.cur.fetchall()
foriinrange(len(tuple)):
sql="""select url from zhihu_answer_picture_url as a where a.answer_id = '{}' """.format(tuple[i][0])
self.cur.execute(sql)
images_url=self.cur.fetchall()
sql="""select root_comment_id, child_comment_count, content, created_time, author_id from zhihu_answer_root_comment as a where a.answerid = '{}' """.format(tuple[i][0])
self.cur.execute(sql)
root_comment=self.cur.fetchall()
comment=[]
forjinrange(len(root_comment)):
ifroot_comment[j][1]!=0:
sql="""select child_comment_id, content, created_time, author_id from zhihu_child_comment as a where a.root_comment_id = '{}' """.format(root_comment[j][0])
sql="""select id, content, created_time, comment_count from zhihu_article"""
self.cur.execute(sql)
topics=[]
tuple=self.cur.fetchall()
foriinrange(len(tuple)):
sql="""select url from zhihu_article_picture_url as a where a.answer_id = '{}' """.format(tuple[i][0])
self.cur.execute(sql)
images_url=self.cur.fetchall()
sql="""select root_comment_id, child_comment_count, content, created_time, author_id from zhihu_article_root_comment as a where a.answerid = '{}' """.format(tuple[i][0])
self.cur.execute(sql)
root_comment=self.cur.fetchall()
comment=[]
forjinrange(len(root_comment)):
ifroot_comment[j][1]!=0:
sql="""select child_comment_id, content, created_time, author_id from zhihu_child_comment as a where a.root_comment_id = '{}' """.format(root_comment[j][0])
sql="""select id, content, created_time, comment_count from zhihu_thought"""
self.cur.execute(sql)
topics=[]
tuple=self.cur.fetchall()
foriinrange(len(tuple)):
sql="""select url from zhihu_thought_picture_url as a where a.answer_id = '{}' """.format(tuple[i][0])
self.cur.execute(sql)
images_url=self.cur.fetchall()
sql="""select thought_comment_id, content, created_time, author_id from zhihu_article_root_comment as a where a.answerid = '{}' """.format(tuple[i][0])