我正在嘗試使用 Power Query 將資料從 Web 直接下載到 Excel 作業表中。資料來源是:

當我運行它時,我收到以下錯誤訊息:

如果我將鏈接粘貼到 Chrome 瀏覽器中,我可以下載該檔案。
我正在使用的 Excel 版本:Microsoft? Excel? for Microsoft 365 MSO(版本 2205 Build 16.0.15225.20278)64 位
任何幫助將不勝感激,因為已經走到了死胡同。
謝謝
uj5u.com熱心網友回復:
excel 作業簿已被錯誤地保存。您可以通過作為文本加載并清理 HTML 來解決此問題。

let
Source = Table.FromColumns({Lines.FromBinary(Web.Contents("https://www.vaneck.com.au/FundHoldings.aspx?ticker=GRNV"), null, null, 1252)}),
#"Filtered Rows" = Table.SelectRows(Source, each [Column1] <> "<tr>"),
#"Filtered Rows1" = Table.SelectRows(#"Filtered Rows", each [Column1] <> "<table cellpadding=""0"" cellspacing=""0"" border=""1"">"),
#"Filtered Rows2" = Table.SelectRows(#"Filtered Rows1", each [Column1] <> "</table>"),
#"Split Column by Delimiter" = Table.SplitColumn(#"Filtered Rows2", "Column1", Splitter.SplitTextByDelimiter("</td><td>", QuoteStyle.Csv), {"Column1.1", "Column1.2", "Column1.3", "Column1.4", "Column1.5", "Column1.6"}),
#"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Column1.1", type text}, {"Column1.2", type text}, {"Column1.3", type text}, {"Column1.4", type text}, {"Column1.5", type text}, {"Column1.6", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","<tr>","",Replacer.ReplaceText,{"Column1.1"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","<td>","",Replacer.ReplaceText,{"Column1.1"}),
#"Replaced Value2" = Table.ReplaceValue(#"Replaced Value1","</td></tr>","",Replacer.ReplaceText,{"Column1.6"}),
#"Filtered Rows3" = Table.SelectRows(#"Replaced Value2", each [Column1.1] <> "<td colspan=6>All Fund Holdings as at 23/06/2022</td></tr>"),
#"Promoted Headers" = Table.PromoteHeaders(#"Filtered Rows3", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Number", Int64.Type}, {"Security name", type text}, {"ASX Code", type text}, {"Shares", Int64.Type}, {"Market Value", type text}, {"% of Fund net assets", Percentage.Type}})
in
#"Changed Type1"
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/495885.html
上一篇:flexbox-我不知道是什么導致這個div在flexbox中有一個被遮擋的空間
下一篇:回圈直到最大結果
