You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:谷歌表格抓取ASX实时精准股价(解决IMPORTXML无效问题)

Fixing ASX Penny Stock Price Scraping in Google Sheets

Hey Ian, I’ve run into this exact ASX stock price snag in Google Sheets before—let’s break down why your current methods aren’t working and get you that precise, up-to-date penny stock price you need.

Why Your Existing Approaches Are Falling Short

Let’s start with the root causes:

  • GOOGLEFINANCE instant price limitation: The formula =googlefinance("ASX.NEA","price") rounds penny stock prices (like your example 0.910) to fewer decimal places, which wipes out the precision you’re after.
  • Historical GOOGLEFINANCE workaround: Your INDEX-based formula for historical prices gives accurate precision, but it only pulls data from prior days—no way to grab today’s live price with this method.
  • IMPORTXML failure: ASX loads share prices dynamically using AngularJS (you spotted the ng-show attributes in the source code). IMPORTXML only reads the static HTML that loads when the page first opens, which doesn’t include the actual price value—hence the #N/A error.

The Reliable Solution: Use ASX’s Public API

ASX offers a free, structured JSON API that serves raw, unrounded stock data—perfect for your penny stock needs. Here’s how to use it in Google Sheets:

Step-by-Step Formula

Use IMPORTDATA to pull the JSON data, then JSON_EXTRACT_SCALAR to grab the exact last price:

=JSON_EXTRACT_SCALAR(IMPORTDATA("https://www.asx.com.au/asx/1/share/NEA"), "$.last_price")
  • This returns the full-precision price (e.g., 0.910 instead of 0.91)
  • The API updates in real-time, so you’ll get the latest available price for the day
  • No fragile XPath selectors that break if ASX tweaks their page layout

How It Works

The ASX API endpoint https://www.asx.com.au/asx/1/share/NEA sends back a JSON object with all key stock details. The $.last_price path targets the exact field holding the unrounded, current price. JSON_EXTRACT_SCALAR pulls that single value out of the JSON response cleanly.

Bonus: Refresh Settings

Google Sheets automatically refreshes the IMPORTDATA feed periodically, but if you want more control:

  • Go to File > Spreadsheet settings
  • Under the Calculation tab, adjust the "Recalculation" interval to your preference (e.g., "On change and every minute")

内容的提问来源于stack exchange,提问作者Ian Finlay

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 08:55:13