如何使用Google表格中的数据发送发帖请求

时间:2018-11-07 16:12:53

标签: python http post request google-sheets-api

我想知道我需要做些什么才能成功发送从Google表格中获取该数据并将其发布到网站的发布请求(让我们说“ www.fc.com” enter image description here)。我一直在搜索网络,但确实看到了一些令人困惑的示例。如果有人可以帮助我,将不胜感激!谢谢!这是我的代码:

import gspread
from oauth2client.service_account import ServiceAccountCredentials
import pprint

scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']
creds = ServiceAccountCredentials.from_json_keyfile_name("client_secret.json", scope)
client = gspread.authorize(creds)

sheet = client.open("python google spreadsheets").sheet1

# Add a new Row!
row = ["I", "am", "Kenny", "Whats", "your", "name", "?"]
index=147
sheet.insert_row(row, index)
print(sheet.row_count)

0 个答案:

没有答案