将未发布的Google电子表格下载为CSV [英] Download unpublished Google spreadsheet as CSV

查看:160
本文介绍了将未发布的Google电子表格下载为CSV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个尚未公开的Google试算表,但只有拥有存取连结的所有人皆可使用。虽然我可以从浏览器访问CSV格式的数据,即使我没有登录到我的Google帐户(也就是说,允许匿名访问),没有办法我可以从命令行使用wget,instante下载数据。我发现几个网页有一些说明来创建下载URL,但到目前为止我没有成功。是否有一个简单,直接的方法这样做或者我将使用一些Google数据库来访问该数据?

I have a Google spreadsheet that has not been made public, but just available to anyone that has the access link. Though I can access the data in CSV format from my browser even when I am not logged into my Google account (that is, anonymous access is allowed), there is no way I can download the data from the command line using wget, for instante. I have found several web pages with some instructions to create the download URL, but so far I've had no success. Is there an easy, straightforward way of doing this or will I have to use some Google Data library to access that data?

推荐答案

现在我可以回答问题,所以我会离开它回答好(从我以前的评论粘贴)。

Now I can answer questions, so I will leave it answered for good (pasting from my previous comment).

我的问题是,我没有正确存储cookie。当时,我正在使用一个Python程序来尝试下载这个。这解决了我报告的问题:

My problem was that I was not storing the cookie correctly. At the time, I was using a Python program to try to download this. This fixed the problem I was reporting:

# Cookie management 
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(CookieJar())) 
csv_data =  csv.reader(opener.open(url))

这篇关于将未发布的Google电子表格下载为CSV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆