简体   繁体   English

如何使用 getJSON(或其他方式)解析 Google 表格?

[英]How can I parse a Google sheet using getJSON (or other way)?

I've a stupid question.我有一个愚蠢的问题。 Here're two links:这里有两个链接:

https://docs.google.com/spreadsheets/d/1D1vL8EI0uRzeiGM-A8hZLgUCexXrocw5B_qTGnCekNE/pubhtml

And

https://spreadsheets.google.com/feeds/list/1D1vL8EI0uRzeiGM-A8hZLgUCexXrocw5B_qTGnCekNE/od6/public/basic?alt=json

When I open the first link in a browser, I can see a table itself, and when I open the second link, I can see some data in JSON.当我在浏览器中打开第一个链接时,我可以看到一个表格本身,当我打开第二个链接时,我可以看到 JSON 中的一些数据。 What is the general rule of such a link conversion?这种链接转换的一般规则是什么? Here are another link for example:这是另一个链接,例如:

https://docs.google.com/spreadsheets/d/e/2PACX-1vS6D5wKWv4IfazLPFrphtG9lL4p4s4Zysmc40kGD22yqsaVhQXLef7M30DbwGT_MpNKHi5dplcQtB3d/pubhtml

How should I transform the link to get JSON?我应该如何转换链接以获得 JSON? I'm going to use jQuery function getJSON to get the contents of a Google sheet.我将使用 jQuery function getJSON来获取 Google 表格的内容。 But what a URL should I give to the function?但是我应该给 function 一个 URL 什么? And are there any other ways to access the contents of a table using JS?还有其他方法可以使用 JS 访问表格的内容吗?

Excuse me for my english!对不起我的英语!

You should try google sheet api for working with sheet您应该尝试使用 Google 表格 api 来使用表格

Google sheet api谷歌表 api

Demo演示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在JQuery中使用getJSON解析并执行JavaScript - How can I parse out and execute JavaScript using getJSON in JQuery 如何解析URL的HTML并使用Google脚本将数据插入Google表格? - How can I parse an URL's HTML and insert data to a Google Sheet using Google Script? 如何使用getJSON从Google解析和列出字体 - how to parse and list down the fonts from google using getJSON 如何使用 Google 脚本从 1 个 Google 工作表中复制特定值并粘贴到另一个工作表? - How can I copy specific values from 1 Google Sheet and paste to another Sheet using Google Script? 如何使用 getJSON 填充下拉 Select 元素 - How Can I Populate Dropdown Select Element using getJSON 如何使用谷歌脚本自动将表单响应从谷歌表格移动到谷歌文档? - How can I automate moving form responses from a google sheet to a google doc using google scripts? 使用 Google Apps 脚本,如何替换 Google 表格模板中的文本以制作新表格? - Using Google Apps Script, how can I replace text in a Google Sheets template to make a new Sheet? $ .getJSON无法解析数组 - $.getJSON can't parse array 如何将谷歌图表数据发送回谷歌表格 - How can I send back google chart data to google sheet Google Script,如何使用正则表达式将一行从 Sheet1 复制到 Sheet2 而不是一个单元格? - Google Script, how can I copy a row from Sheet1 to Sheet2 instead of just one cell by using regex?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM