longxiaofei / spider-BaiduIndex

data sdk for baidu Index
MIT License
749 stars 229 forks source link

厉害呀 大神!,就想请问下,1.搜到的结果怎么保存到excel?? #31

Closed lan-slot closed 2 years ago

lan-slot commented 3 years ago

厉害呀 ,就想请问下,搜到的结果怎么保存到excel?? 本人新手小白,pandas ,baidu_index.to_csv('niushi',index = False) 失败呀

cyzhangsjtu commented 3 years ago

同问,搜下结果怎么保存到excel!

Adam-lxd commented 3 years ago

可以用pandas,用DataFrame装数据,最后调用to_sql方法就行。用法可以参考:https://pandas.pydata.org/pandas-docs/version/0.21/generated/pandas.DataFrame.to_csv.html#pandas.DataFrame.to_csv