为什么爬出来是一串utf8
如题。
如题。
 
                            2018-12-02
fout = open("output.html", 'w', encoding='utf-8')
fout.write('<html>')
#让浏览器以utf-8的编码显示
fout.write("<meta charset=\"utf-8\">")
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()举报