old_contents: #-*- coding: UTF-8 -*-
  from io import open
  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('output.fail.2', 'wb+')
  	fout.write('---------------------------\n')
  	for data in self.datas:
  		for k in data.keys():
  			a = k + ":" +data[k]+'\n'
  			fout.write(a )
  		fout.write('---------------------------\n')
  	#	print '--------------------------------------------'	
  
  
  '''        fout = open('output.html', 'w',encode='utf-8')
  
          fout.write("<html>")
          fout.write("<head><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\"></head>")
          fout.write("<body>")
          fout.write("<table>")
  
          for data in self.datas:
              fout.write("<tr>")
              fout.write("<td>%s</td>" % data['url'])
              fout.write("<td>%s</td>" % data['title'])
              fout.write("<td>%s</td>" % data['summary'])
              fout.write("</tr>")
  
          fout.write("</table>")
          fout.write("</body>")
          fout.write("</html>")
          fout.close()
  '''
  
new_contents: #-*- coding: UTF-8 -*-
  from io import open
  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('output.fail.2', 'wb+')
  	fout.write('---------------------------\n')
  	for data in self.datas:
  		for k in data.keys():
  			a = k + ":" +data[k]+'\n'
  			fout.write(a )
  		fout.write('---------------------------\n')
  
subject: change the output method