首页 > 解决方案 > SSIS 中的 Power Query - 不支持 Html.Table

问题描述

SSIS 支持 Power Query 作为 Source,但似乎不支持使用 Html.Table 的 M 代码。我只使用 SQL Server Data Tools (SSDT)

M代码如下=

 let Scrapper =

(Page as number) as table =>
let
    Source = Web.BrowserContents("https://www.zerohedge.com/?page=" & Number.ToText(Page)),
    #"Extracted Table From Html" = Html.Table(Source, {{"Title", ".teaser-title:nth-last-child(4)"}, {"Date", ".extras__created:nth-last-child(1)"}, {"Views", ".extras__views:nth-last-child(2)"}}, [RowSelector=".view-content:nth-last-child(2) > DIV.views-row"]),
    #"Changed Type" = Table.TransformColumnTypes(#"Extracted Table From Html",{{"Title", type text}, {"Date", type datetime}, {"Views", Int64.Type}})
in
    #"Changed Type",



    Source = {0..1},
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "Pages"}}),
    #"Invoked Custom Function" = Table.AddColumn(#"Renamed Columns", "Scrapper", each Scrapper([Pages])),
    #"Expanded Scrapper" = Table.ExpandTableColumn(#"Invoked Custom Function", "Scrapper", {"Title", "Date", "Views"}, {"Title", "Date", "Views"})
in
    #"Expanded Scrapper"

错误:数据流任务中的 0x0,Power Query 源:导入 Html.Table 不匹配导出。您是否错过了模块参考?

我没有看到任何其他等待微软支持 Html.table 的解决方案

SSDT 中的错误图像

标签: ssispowerbipowerqueryazure-data-factory

解决方案


推荐阅读