class HtmlOutputer(object):
def __init__(self):
self.datas = []
def collect_data(self,data):
if data is None:
return
self.datas.append(data)
def output_html(self):
fout = open(r'D:\baidu download\java\output.html', 'w')
fout.write("")
fout.write("
")fout.write("
for data in self.datas:
#fout.write('')
fout.write("
")fout.write("
%s" % data['url'])fout.write("
%s" % data['title'].encode('utf-8'))fout.write("
%s" % data['Summary'].encode('utf-8'))fout.write("
")fout.write("")
fout.write("")