Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.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
Google sheets 如何在谷歌电子表格中获取台湾证券交易所指数_Google Sheets_Google Spreadsheet Api_Google Finance_Google Finance Api - Fatal编程技术网

Google sheets 如何在谷歌电子表格中获取台湾证券交易所指数

Google sheets 如何在谷歌电子表格中获取台湾证券交易所指数,google-sheets,google-spreadsheet-api,google-finance,google-finance-api,Google Sheets,Google Spreadsheet Api,Google Finance,Google Finance Api,如何在谷歌电子表格中获取台湾证券交易所指数? 这个索引确实存在于谷歌财经下 我尝试了以下公式,但都失败了 =GoogleFinance("TPE:TAIEX"; "price") =GoogleFinance("TPE.TAIEX"; "price") =GoogleFinance("TAIEX.TW"; "price") =GoogleFinance("TAIEX:TPE"; "price") =GoogleFinance("TAIEX.TPE"; "price") =GoogleFinanc

如何在谷歌电子表格中获取台湾证券交易所指数? 这个索引确实存在于谷歌财经下

我尝试了以下公式,但都失败了

=GoogleFinance("TPE:TAIEX"; "price")
=GoogleFinance("TPE.TAIEX"; "price")
=GoogleFinance("TAIEX.TW"; "price")
=GoogleFinance("TAIEX:TPE"; "price")
=GoogleFinance("TAIEX.TPE"; "price")
=GoogleFinance("TPE%3ATAIEX"; "price")

我可以建议你解决以下两个问题:

appscript技巧:
构建一个google应用程序脚本,从您喜爱的站点检索数据。下面是一个网站的例子。我不知道这个示例是否符合您的需要,这样您就可以很容易地更改脚本更改regexp和站点url。
请注意,由于我是法国人,我需要更改“,”for“。这对您来说可能没有必要

function twn(){
var feed = UrlFetchApp.fetch("http://www.bloomberg.com/quote/TWSE:IND");  // URL of your favorite site
  var taux = feed.getContentText().match(/meta itemprop\="price" content\="[0-9,\.]*"/); // looking for a regexp in the retrieved page
  taux = taux[0].slice(31,taux[0].length-1); // cleaning around what you retrieved
  taux = taux.replace(",",""); // french trick
  taux = taux.replace(".",","); // french trick
  Logger.log("taux: "+taux); // a little log to check Is I'm not doing anything bad
  return(taux); // result displayed in your spreadsheet when you call function twn()
}
电子表格技巧:

在电子表格中使用以下公式:
=mid(REGEXEXTRACT(concatenate(Importdata)()http://www.bloomberg.com/quote/TWSE:IND);“itemprop=”“price”“content=“[0-9,\.]*”;27;10)

:“谷歌金融仅提供英文版本,不支持大多数国际交易所”。我想这就是问题所在。
=GoogleFinance("TWII"; "price")