想要处理用python抓取的数据,并且要导出到excel? 10
这是我抓取的网页代码然后网站的显示是这样的我想要处理成excel请问怎样处理,怎样导出?谢谢啦...
这是我抓取的网页代码然后网站的显示是这样的我想要处理成excel请问怎样处理,怎样导出?谢谢啦
展开
2个回答
展开全部
import json
data = {"data":[
{"id":"1","price_data":"2017-01-06","nav":"1.516900","cumulativate_nav_withdrawa1":"1.516900"},
{"id":"1","price_data":"2017-01-02","nav":"1.516900","cumulativate_nav_withdrawa1":"1.516900"},
{"id":"1","price_data":"2017-01-03","nav":"1.516900","cumulativate_nav_withdrawa1":"1.516900"},
{"id":"1","price_data":"2017-01-05","nav":"1.516900","cumulativate_nav_withdrawa1":"1.516900"},
{"id":"1","price_data":"2017-01-07","nav":"1.516900","cumulativate_nav_withdrawa1":"1.516900"}
]}
json_str = json.dumps(data)
jsonData = json.loads(json_str)
all_data = jsonData["data"]
for item in all_data:
#导出代码在这里实现
print item['price_data'],item['nav'],item['cumulativate_nav_withdrawa1']
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询