主要针对https://mp.csdn.net/mp_blog/creation/editor/129679156爬取数据表头问题进行处理
采用pandas进行表头的添加,代码如下:
import pandas as pd
data=pd.read_csv('D:\shop3.csv',header=0,names=["店名","地址","电话","营业时间"])
data.to_csv('D:\shop3.csv',index=False,encoding="utf_8_sig")
不加encoding就是乱码