Ниже код был автоматически сгенерирован в Power BI и хотел продублировать его в Excel.Однако существует ошибка выражения «Импорт Html.Table не соответствует экспорту. Вы пропустили ссылку на модуль?».
Я скопировал и вставил код из кода расширенного редактора PowerBI в код расширенного редактора Excel ниже
let
Source = Web.BrowserContents("http://edge.pse.com.ph/disclosureData/dividends_and_rights_info_form.do"),
#"Extracted Table From Html" = Html.Table(Source, {{"Company Name", "DIV[id='dataList'] > TABLE.list:nth-child(7) > TBODY > TR > :nth-child(1)"}, {"Type of Security", "DIV[id='dataList'] > TABLE.list:nth-child(7) > TBODY > TR > :nth-child(2)"}, {"Type of Dividend", "DIV[id='dataList'] > TABLE.list:nth-child(7) > TBODY > TR > :nth-child(3)"}, {"Dividend Rate", "DIV[id='dataList'] > TABLE.list:nth-child(7) > TBODY > TR > :nth-child(4)"}, {"Ex-dividend Date", "DIV[id='dataList'] > TABLE.list:nth-child(7) > TBODY > TR > :nth-child(5)"}, {"Record Date", "DIV[id='dataList'] > TABLE.list:nth-child(7) > TBODY > TR > :nth-child(6)"}, {"Payment date", "DIV[id='dataList'] > TABLE.list:nth-child(7) > TBODY > TR > :nth-child(7)"}, {"Circular Number", "DIV[id='dataList'] > TABLE.list:nth-child(7) > TBODY > TR > :nth-child(8)"}}, [RowSelector="DIV[id='dataList'] > TABLE.list:nth-child(7) > TBODY > TR"]),
#"Changed Type" = Table.TransformColumnTypes(#"Extracted Table From Html",{{"Company Name", type text}, {"Type of Security", type text}, {"Type of Dividend", type text}, {"Dividend Rate", type text}, {"Ex-dividend Date", type date}, {"Record Date", type date}, {"Payment date", type date}, {"Circular Number", type text}})
in
#"Changed Type"
Весь отчет создан в Excel.Предпочитайте извлекать таблицу в Excel, так как некоторые требуемые функции недоступны в PowerBI.