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:","")

沒有留言:

熱門文章