")
25 fout.write("
26 fout.close()
27
28 def output_html(self,path):
29 '''
30 将数据写入HTML文件中
31 :param path: 文件路径
32 :return:
33 '''
34 fout=codecs.open(path,'a',encoding='utf-8')
35 for data in self.datas:
36 fout.write("
37 fout.write("
%s"%data['url'])38 fout.write("
%s"%data['title'])39 fout.write("
%s"%data['summary'])40 fout.write("
")41 self.datas.remove(data)
42 fout.close()
43
44 def ouput_end(self,path):
45 '''
46 输出HTML结束
47 :param path: 文件存储路径
48 :return:
49 '''
50 fout=codecs.open(path,'a',encoding='utf-8')
51 fout.write("
")52 fout.write("