Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
EnochS
Helper II
Helper II

Expand HTML Links from Excel Table in Query Editor

Hello,

 

Does anyone know how to expand the HTML links inside of table? I have an excel table that I created with many links. I have loaded this file into Power BI Desktop in Query Editor and have been trying to "Expand" the html links to display the data found in those links (which are more tables). I thought this might expedite the process instead of creating a new table for each link.. Is there an efficient way to do this? Maybe I need to export this into a web page as an html file? If the way I'm trying doesnt work, is there any other method of doing this more efficiently if i have multiple data sources?

 

Thanks for any help.

 

File Link:
HTML List Example.XLSX

 

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@EnochS,

There is no data when I open your HTML link. However, you can perform the following steps to get data from all the links in Query Editor.

1. Split the Project Bidding column to get the number. This step generates the following code, you can copy it to the Advanced Editor of your query.

#"Split Column by Delimiter" = Table.SplitColumn(#"Changed Type", "Projects Bidding", Splitter.SplitTextByEachDelimiter({"/"}, QuoteStyle.Csv, true), {"Projects Bidding.1", "Projects Bidding.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Projects Bidding.1", type text}, {"Projects Bidding.2", type text}}),
    #"Split Column by Delimiter1" = Table.SplitColumn(#"Changed Type1", "Projects Bidding.1", Splitter.SplitTextByEachDelimiter({"/"}, QuoteStyle.Csv, true), {"Projects Bidding.1.1", "Projects Bidding.1.2"}),

1.JPG

2. Add a new blank query and paste the following code in the Advanced Editor of the blank query. And rename the query to fnGetByid.

let
fnGetByid = (urlid as text) =>
let
    Source = Web.Page(Web.Contents(Text.Replace("http://www.bxwa.com/bxwa_toc/private/{id}/toc.html","{id}", urlid))),
    Data0 = Source{0}[Data]
in
    Data0
in
fnGetByid

3. Add a custom column in the Data table which is imported from the Excel file, then expand the custom column.

=fnGetByid([Projects Bidding.1.2])

2.JPG3.JPG

Reference:
https://kzhendev.wordpress.com/2014/04/14/scraping-the-web-with-power-query/

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yuezhe-msft
Employee
Employee

@EnochS,

There is no data when I open your HTML link. However, you can perform the following steps to get data from all the links in Query Editor.

1. Split the Project Bidding column to get the number. This step generates the following code, you can copy it to the Advanced Editor of your query.

#"Split Column by Delimiter" = Table.SplitColumn(#"Changed Type", "Projects Bidding", Splitter.SplitTextByEachDelimiter({"/"}, QuoteStyle.Csv, true), {"Projects Bidding.1", "Projects Bidding.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Projects Bidding.1", type text}, {"Projects Bidding.2", type text}}),
    #"Split Column by Delimiter1" = Table.SplitColumn(#"Changed Type1", "Projects Bidding.1", Splitter.SplitTextByEachDelimiter({"/"}, QuoteStyle.Csv, true), {"Projects Bidding.1.1", "Projects Bidding.1.2"}),

1.JPG

2. Add a new blank query and paste the following code in the Advanced Editor of the blank query. And rename the query to fnGetByid.

let
fnGetByid = (urlid as text) =>
let
    Source = Web.Page(Web.Contents(Text.Replace("http://www.bxwa.com/bxwa_toc/private/{id}/toc.html","{id}", urlid))),
    Data0 = Source{0}[Data]
in
    Data0
in
fnGetByid

3. Add a custom column in the Data table which is imported from the Excel file, then expand the custom column.

=fnGetByid([Projects Bidding.1.2])

2.JPG3.JPG

Reference:
https://kzhendev.wordpress.com/2014/04/14/scraping-the-web-with-power-query/

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.