2022年3月19日 星期六

[google finance] 用 Google 試算表抓取 元大美債20年00679B 股價資料(google finance)

1. 打開 Google 試算表

2. 輸入以下公式

=IMPORTXML("https://tw.stock.yahoo.com/quote/00679B","//*[@id='main-0-QuoteHeader-Proxy']/div/div[2]/div[1]/div/span[1]")

注意:B要大寫喔!

=IMPORTXML("https://histock.tw/stock/00679b","//*[@id='Price1_lbTPrice']/span")

=Index(ImportHtml("http://bigcharts.marketwatch.com/advchart/frames/frames.asp?symb=00679b", "table"),3,1)

加個 substitute() 可以取代不想要的字

=Substitute(Index(ImportHtml("http://bigcharts.marketwatch.com/advchart/frames/frames.asp?symb=00679b", "table"),3,1),"Last:","")


其他可參考以下:

[google finance] [google finance] 用 Google 試算表公式輕鬆抓取 元大美債20年(00679B) 股名、股價、漲跌點數、漲跌幅(百分比)

[google finance] 用 Google 試算表抓取 國泰美債20年00687B 股價資料

[google finance] 用 Google 試算表抓取 群益ESG投等債20+(00937B) 股價資料






沒有留言:

熱門文章