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
reynaldo_malave
Helper III
Helper III

web.browsercontents and html.table not working and not loading entire table

 

Hi Devs, 

 

I am trying to get a httml table out of the following address "https://e.infogram.com/81277d3a-5813-46f7-a270-79d1768a70b2" at first i got a table which powerquery returned using html.table with 100 rows out of 346 but now it just returns the html code. 

 

I can see the table in the code near the end under "data": but i just dont know how to extract it.

 

Thanks in advance,

 

Reynaldo

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

The data is actually embedded in a javascript script, so you need to extract that part and then interpret as rows.

 

let
Source = Web.BrowserContents("https://e.infogram.com/81277d3a-5813-46f7-a270-79d1768a70b2"),
d = Text.PositionOf(Source,"data"":[[["),
e = Text.PositionOf(Source,"]]]"),
j = Table.FromRows(Json.Document(Text.Range(Source,d+7,e-d-5))),
#"Promoted Headers" = Table.PromoteHeaders(j, [PromoteAllScalars=true])
in
#"Promoted Headers"

 

 

View solution in original post

5 REPLIES 5
lbendlin
Super User
Super User

you are right, the format of the HTML has changed.  The data is now in <table class="igc-table __fixed __dynamic"> and it looks like the entire HTML page is generated on the fly. Use a web traffic monitor to see if you can intercept or emulate the download button.

 

Or - ask the data source owner if they can provide a user friendly API.

 

 

@lbendlin Thanks for your time! i will be asking

reynaldo_malave
Helper III
Helper III

@lbendlin  Thanks this one was far beyond my skillset. Any documentation I can read to get a hold of what you just did with variable j.

 

Once again thank you

lbendlin
Super User
Super User

The data is actually embedded in a javascript script, so you need to extract that part and then interpret as rows.

 

let
Source = Web.BrowserContents("https://e.infogram.com/81277d3a-5813-46f7-a270-79d1768a70b2"),
d = Text.PositionOf(Source,"data"":[[["),
e = Text.PositionOf(Source,"]]]"),
j = Table.FromRows(Json.Document(Text.Range(Source,d+7,e-d-5))),
#"Promoted Headers" = Table.PromoteHeaders(j, [PromoteAllScalars=true])
in
#"Promoted Headers"

 

 

@lbendlin sorry to write you again. But now I  cant find the table within the source. I mean data[[[]]] is empty. It worked fine when I first load it but then it asked me for a security check up (public, anonimous, etc..) for connecting to the website and now source is just plain empty. Any ideas?

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.

Top Solution Authors
Top Kudoed Authors