Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用共享链接访问google电子表格_Python_Google Sheets_Gspread - Fatal编程技术网

Python 使用共享链接访问google电子表格

Python 使用共享链接访问google电子表格,python,google-sheets,gspread,Python,Google Sheets,Gspread,我正在构建一个python应用程序,用户可以提供“任何人都可以编辑”的链接到他们的电子表格,并且可以从那里读取数据。我正在使用python的gspread模块,但它抛出了SpreadSheetNotFound错误 import gspread from oauth2client.service_account import ServiceAccountCredentials scope = ['https://spreadsheets.google.com/feeds'] credentials

我正在构建一个python应用程序,用户可以提供“任何人都可以编辑”的链接到他们的电子表格,并且可以从那里读取数据。我正在使用python的gspread模块,但它抛出了SpreadSheetNotFound错误

import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds']
credentials = ServiceAccountCredentials.from_json_keyfile_name('myauth.json', scope)
gc = gspread.authorize(credentials)
wks = gc.open_by_url(urls_given_by_user_having_edit_permission)
上面的代码不起作用。有什么办法可以做到这一点吗?

wks.share(“”,perm_type='any',role='reader'))


具有链接的所有人的阅读权限。参考

您是否可以共享具有编辑权限的用户提供的
URL格式?只是给出一个值的一般概念。如果要隐藏实际值,可以省略一些字符。@Burnash与d/后面的值是键的位置类似。我正在寻找任何方法来完成上述任务,对gspread不严格。您是否尝试按键打开电子表格?另一种可能的解决方案是通过json接口访问电子表格:for list和forcells@BurnashByKey从url中提取密钥,就是这样,但效果不好。feed将从我们自己的帐户中提供电子表格,不是吗?我想访问另一个拥有编辑权限的用户的文档。