我想用Python连接到Google Spreadsheets API。
所以我这样做:
import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope=['https://www.googleapis.com/auth/spreadsheets',
'https://wwww.googleapis.com/auth/drive']
credentials = ServiceAccountCredentials.from_json_keyfile_name('cred.json', scope)
gc = gspread.authorize(credentials)
wks = gc.open('datatest').Sheet1
print(wks.get_all_records)
但是我得到了这个错误
HttpAccessTokenRefreshError: invalid_scope: https://www.googleapis.com/auth/spreadsheets is not a valid audience string.
如何使用Google-auth代替gspread来处理这些数据?
你输入4w !!!!
X'https://wwww.googleapis.com/auth/drive'
'Kua zxsw指向'
https://www.googleapis.com/auth/drive
希望它有所帮助。