我正试图将当前的股票价格数据从ASX转到谷歌电子表格中。
我不使用=googlefinance("ASX.NEA","price")作为即时延迟价格,因为决议绕过了便士股票的价值。
我不使用=INDEX(googlefinance("ASX.NEA","price", today()-10, today()),2,2)的历史价格,这不能得到当前的价格,即使决议价格是准确的。
https://www.asx.com.au/asx/share-price-research/company/NEA/html/body/section[3]/article/div[1]/div/div/div[4]/div[1]/div[1]/company-summary/table/tbody/tr[1]/td[1]/span=IMPORTXML(url, xpath)我尝试过的其他路径包括:
//table/tbody//span//span[@ng-show="share.last_price"]//span[@ng-show="share.last_price"]当我查看页面源时,最新的股价是通过javascript加载的。
例子:股价是0.910。

发布于 2018-06-01 08:49:20
使用Apps脚本的替代解决方案(javascript)
function AsxPrice(asx_stock) {
var url = "https://www.asx.com.au/asx/1/share/" + asx_stock +"/";
var response = UrlFetchApp.fetch(url);
var content = response.getContentText();
Logger.log(content);
var json = JSON.parse(content);
var last_price = json["last_price"];
return last_price;
}这比importXML()或ImportHTML()作为HTML膨胀的效率要高得多,上面的url是一个above结果。
对于其他大型证券交易所(可在以下网址找到json的来源):
欧盟-美国
https://stackoverflow.com/questions/50636351
复制相似问题