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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
ConfusedTurtle2
New Member

Automating extraction of table from HTML

Hi all,

 

I'm using an API to get data from statistics.gov.scot into Power BI. The second applied step after importing the data, 'Extracted Table from Html', uses a script like the following:

 

 

= Html.Table(Source, {{"Column1", "TABLE.clay_cube_slice > * > TR > :nth-child(1)"}, {"Column2", "TABLE.clay_cube_slice > * > TR > :nth-child(2)"}}, [RowSelector="TABLE.clay_cube_slice > * > TR"])

 

 

The issue is when this dataset is updated the latest value is a new column which is not pulled in. I realise this is because the above query is manually selecting a set amount of columns and this can be fixed by adding the new column to this script each month, but for the purposes of what I'm doing it would be much better if I could simply refresh my data and have it automatically include the latest available data. That being the case is there a way to automate the above process so it will just take all columns, even as more are added as the data is updated?

 

Thanks

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Since they have an API you may just as well use it, instead of laboring around with screen scraping.

 

API - statistics.gov.scot Open Data User Guides

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

Since they have an API you may just as well use it, instead of laboring around with screen scraping.

 

API - statistics.gov.scot Open Data User Guides

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.