Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
I am looking to collect the information highlighted red in the code snippit below using PQ. The table imports just fine with the PQ code, but I can't figure out how to extract the highlighted text. Any ideas? Thanks!!!
TARGET CODE
<table class="table table-bordered table-hover1 table-responsive table-condensed">
<caption>
File Results
<a class="btn btn-primary btn-sm" href="/RequestAllSelectedFiles" title="Request Files">Request Files</a>
</caption>
<tbody><tr>
<th class="text-center">
Select
</th>
<th>
File Name
</th>
<th>
File Size
</th>
</tr>
<tr>
<td class="text-center">
<input type="checkbox" onchange="ToggleItemSelected(2878219);" id="CheckboxForFileNumber2878219" name="CheckboxForFileNumber2878219">
</td>
<td class="text-left">
03723592_1988-12-20_DI-SFL-LCL.tif
</td>
<td class="text-center">
<span title="approximately 48 Megabytes">~ 48 MB</span>
</td>
</tr>
<tr>
<td class="text-center">
<input type="checkbox" onchange="ToggleItemSelected(2878218);" id="CheckboxForFileNumber2878218" name="CheckboxForFileNumber2878218">
</td>
<td class="text-left">
03723592_1988-12-20_DI-SFL-LCL.pdf
</td>
<td class="text-center">
<span title="approximately 8 Megabytes">~ 8 MB</span>
</td>
</tr>
<tr>
<td class="text-center">
<input type="checkbox" onchange="ToggleItemSelected(2878217);" id="CheckboxForFileNumber2878217" name="CheckboxForFileNumber2878217">
</td>
<td class="text-left">
03723592_1988-12-20_DIRSV.pdf
</td>
<td class="text-center">
<span title="approximately 1 Megabytes">~ 1 MB</span>
</td>
</tr>
</tbody></table>
PQ CODE
let
Source = Web.BrowserContents(MY TARGET WEBSITE),
#"Extracted Table From Html" = Html.Table(Source, {
{"Column1", "TABLE.table.table-bordered.table-hover1.table-responsive.table-condensed > * > TR > :nth-child(1)"},
{"Column2", "TABLE.table.table-bordered.table-hover1.table-responsive.table-condensed > * > TR > :nth-child(2)"},
{"Column3", "TABLE.table.table-bordered.table-hover1.table-responsive.table-condensed > * > TR > :nth-child(3)"}}, [RowSelector="TABLE.table.table-bordered.table-hover1.table-responsive.table-condensed > * > TR"])
Solved! Go to Solution.
Give this a go
let
Source = Web.BrowserContents("https://www.myonlinetraininghub.com/test/example-table.html"),
#"Converted to Table" = #table(1, {{Source}}),
#"Added Custom" = Table.AddColumn(#"Converted to Table", "Custom", each let _list = List.Transform(Text.Split([Column1], "name="), each Text.Middle(_ , 1, Text.PositionOf(_, ">")-2))
in List.LastN(_list , List.Count(_list) -1)),
#"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
#"Removed Columns" = Table.RemoveColumns(#"Expanded Custom",{"Column1"})
in
#"Removed Columns"
I've copied your <table> code and put it in a file on my site that can be loaded with this query.
Regards
Phil
Proud to be a Super User!
Just use Text.Split as the below code
let
Source = Web.BrowserContents("https://www.myonlinetraininghub.com/test/example-table.html"),
Extract = List.Transform({0..30}, each Text.BetweenDelimiters(Source, "name=""",""">" ,_))
in
Extract
Just use Text.Split as the below code
let
Source = Web.BrowserContents("https://www.myonlinetraininghub.com/test/example-table.html"),
Extract = List.Transform({0..30}, each Text.BetweenDelimiters(Source, "name=""",""">" ,_))
in
Extract
Give this a go
let
Source = Web.BrowserContents("https://www.myonlinetraininghub.com/test/example-table.html"),
#"Converted to Table" = #table(1, {{Source}}),
#"Added Custom" = Table.AddColumn(#"Converted to Table", "Custom", each let _list = List.Transform(Text.Split([Column1], "name="), each Text.Middle(_ , 1, Text.PositionOf(_, ">")-2))
in List.LastN(_list , List.Count(_list) -1)),
#"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
#"Removed Columns" = Table.RemoveColumns(#"Expanded Custom",{"Column1"})
in
#"Removed Columns"
I've copied your <table> code and put it in a file on my site that can be loaded with this query.
Regards
Phil
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
31 | |
30 | |
20 | |
15 | |
12 |
User | Count |
---|---|
20 | |
18 | |
13 | |
10 | |
10 |