Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I want to extract the system status from the following page:
I was able to pull the html data, now I just want to pull the line that says "All Systems Operational", is there a way to use the <div class="page-status status-none"> as a delimiter so I can extract the data that is 2 rows below?
p.s. I'm thinking about using the html tag as a delimiter, because if I use the line number... it might change with the time.
Solved! Go to Solution.
pls try this
let
Source = Text.FromBinary(Web.Contents("https://www.akamaistatus.com/")),
Text = Text.BetweenDelimiters( Source, "<span class=""status font-large"">", "<span class=""last-updated-stamp font-small""></span>" ),
ImportedText = List.RemoveMatchingItems( List.Transform(Lines.FromText(Text),(x)=> Text.Trim(x)),{""}){0}
in
ImportedText
pls try this
let
Source = Text.FromBinary(Web.Contents("https://www.akamaistatus.com/")),
Text = Text.BetweenDelimiters( Source, "<span class=""status font-large"">", "<span class=""last-updated-stamp font-small""></span>" ),
ImportedText = List.RemoveMatchingItems( List.Transform(Lines.FromText(Text),(x)=> Text.Trim(x)),{""}){0}
in
ImportedText
Thank you @Ahmedx ! That works perfectly...
Can you explain the following line and tell me where can I learn more about it?
ImportedText = List.RemoveMatchingItems( List.Transform(Lines.FromText(Text),(x)=> Text.Trim(x)),{""}){0}
Lines.FromText(Text)
: This function converts the variable Text
into a list of lines. Each line from the text becomes an individual element in the list.
List.Transform(..., (x) => Text.Trim(x))
: This applies a transformation to each line in the list created in step 1. The transformation involves trimming the whitespace from both the beginning and end of each line using Text.Trim(x)
.
List.RemoveMatchingItems(..., {""})
: This removes any empty strings (i.e., ""
) from the list that resulted from the transformation in step 2. If any lines were just whitespace, they are removed at this point because they become empty after trimming.
{0}
: This refers to the first element of the remaining list after empty strings are removed. It extracts the first non-empty line of the original text.
Best to use Web.BrowserContents and then play with Html.Table parsing
let
Source = Web.BrowserContents("https://www.akamaistatus.com/"),
#"Extracted Table From Html" = Html.Table(Source, {{"Column1", ".font-small + *"}, {"Column2", ".component-inner-container:nth-child(2) .name"}, {"Column3", ".component-inner-container:nth-child(3) .name"}, {"Column4", ".component-status.tool"}, {"Column5", ".component-inner-container:nth-child(2) .component-status"}, {"Column6", ".component-inner-container:nth-child(3) .component-status"}, {"Column7", ".component-inner-container:nth-child(4) .name"}, {"Column8", ".component-inner-container:nth-child(4) .component-status"}}, [RowSelector=".component-container"])
in
#"Extracted Table From Html"
Thank you very much for your answer, I see multiple outputs with their status...but I was looking just to capture the general status of the page: "All systems operational".
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
17 | |
9 | |
8 | |
7 | |
7 |