我有一個Google電子表格,我想通過Google Python客戶端讀取。這個電子表格是私人的。下面是代碼:使用Python客戶端庫讀取私人Google電子表格
import gdata
import gdata.docs
import gdata.spreadsheet
import gdata.spreadsheet.service
client = gdata.spreadsheet.service.SpreadsheetsService()
client.email = '[email protected]'
client.password = 'yyyyy'
client.ProgrammaticLogin()
spreadsheet_feed = client.GetFeed('http://spreadsheets.google.com/feeds/spreadsheets/private/full')
first_entry = spreadsheet_feed.entry[0]
key = first_entry.id.text.rsplit('/')[-1]
worksheets_feed = client.GetWorksheetsFeed(key)
for entry in worksheets_feed.entry:
print entry.title.text
這給了我下面的錯誤:
client.ProgrammaticLogin()
File "C:\python27\lib\site-packages\gdata\service.py", line 793, in ProgrammaticLogin
raise BadAuthentication, 'Incorrect username or password'
gdata.service.BadAuthentication: Incorrect username or password
爲什麼,即使用戶名/密碼是否正確,用戶名是在公司領域,但在谷歌服務器?