網頁

2024年9月13日 星期五

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

1. 打開 Google 試算表

2. 輸入以下公式

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

注意:B要大寫喔!

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

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

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

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

沒有留言:

張貼留言