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.
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
Solved! Go to Solution.
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"
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 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
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?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.