安装prettytable:
pip install prettytable
测试对爬取数据的表格显示:
#coding:utf8
import prettytable as pt
def main():
tb = pt.PrettyTable()
tb.field_names = ["用户名","时间","URI","地址","文件名"]
for i in range(1,10,1):
tb.add_row([i,'time','uri','addres','filename'])
print tb
if __name__ == '__main__':
main()
参考:
https://www.cnblogs.com/Mr-Koala/p/6582299.html