输出文件output.html里没有记录
代码运行爬取1000个记录成功,但最后出现:
Traceback (most recent call last):
File "C:\Users\宋杰\workspace\TestPython\baike_spider\spider_main.py", line 35, in <module>
obj_spider.craw(root_url)
File "C:\Users\宋杰\workspace\TestPython\baike_spider\spider_main.py", line 30, in craw
self.outputer.output_html()
File "C:\Users\宋杰\workspace\TestPython\baike_spider\html_outputer.py", line 29, in output_html
fout.write("<td>s%</td>" % data["url"])
ValueError: unsupported format character '<' (0x3c) at index 6
并且output文件里只有:<html><body><table><tr>