写csv文件时报错,如下:UnicodeEncodeError: 'gbk' codec can't encode character '\xa0' in position 302: illegal multibyte sequence
改为:加编码限制:encoding = "utf-8"
with open("C:\\Users\\xxx\\Desktop\\newdata.csv",'w',encoding = "utf-8",newline='') as file:
writer = csv.writer(file)
writer.writerows(li)