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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How to load HTML table from a webpage having multiple pages

Hello,

 

I am trying to import HTML tables data from the website mentioned below. Unfortunately I am able to import only the first 15 rows from first page/table. There are 19 pages/tables which pointing to the same link. How do I loop to the next page/table and extract data within same PBI?

 

Please suggest necessary changes to the 'M' code

 

URL: https://www.coronavirus.vic.gov.au/exposure-sites

 

let
Source = Web.BrowserContents("https://www.coronavirus.vic.gov.au/exposure-sites"),
#"Extracted Table From Html" = Html.Table(Source, {{"Column1", "TABLE.rpl-search-results-table > * > TR > TH[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6), TABLE.rpl-search-results-table > * > TR > TD[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6)"}, {"Column2", "TABLE.rpl-search-results-table > * > TR > TH[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6), TABLE.rpl-search-results-table > * > TR > TD[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6)"}, {"Column3", "TABLE.rpl-search-results-table > * > TR > TH[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6) + TH[colspan=""2""]:not([rowspan]):nth-child(2):nth-last-child(5), TABLE.rpl-search-results-table > * > TR > TD[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(2):nth-last-child(5)"}, {"Column4", "TABLE.rpl-search-results-table > * > TR > TH[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6) + TH[colspan=""2""]:not([rowspan]):nth-child(2):nth-last-child(5), TABLE.rpl-search-results-table > * > TR > TD[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(2):nth-last-child(5)"}, {"Column5", "TABLE.rpl-search-results-table > * > TR > TH[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6) + TH[colspan=""2""]:not([rowspan]):nth-child(2):nth-last-child(5) + TH[colspan=""1""]:not([rowspan]):nth-child(3):nth-last-child(4), TABLE.rpl-search-results-table > * > TR > TD[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(2):nth-last-child(5) + TD[colspan=""1""]:not([rowspan]):nth-child(3):nth-last-child(4)"}, {"Column6", "TABLE.rpl-search-results-table > * > TR > TH[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6) + TH[colspan=""2""]:not([rowspan]):nth-child(2):nth-last-child(5) + TH[colspan=""1""]:not([rowspan]):nth-child(3):nth-last-child(4) + TH[colspan=""2""]:not([rowspan]):nth-child(4):nth-last-child(3), TABLE.rpl-search-results-table > * > TR > TD[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(2):nth-last-child(5) + TD[colspan=""1""]:not([rowspan]):nth-child(3):nth-last-child(4) + TD[colspan=""2""]:not([rowspan]):nth-child(4):nth-last-child(3)"}, {"Column7", "TABLE.rpl-search-results-table > * > TR > TH[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6) + TH[colspan=""2""]:not([rowspan]):nth-child(2):nth-last-child(5) + TH[colspan=""1""]:not([rowspan]):nth-child(3):nth-last-child(4) + TH[colspan=""2""]:not([rowspan]):nth-child(4):nth-last-child(3), TABLE.rpl-search-results-table > * > TR > TD[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(2):nth-last-child(5) + TD[colspan=""1""]:not([rowspan]):nth-child(3):nth-last-child(4) + TD[colspan=""2""]:not([rowspan]):nth-child(4):nth-last-child(3)"}, {"Column8", "TABLE.rpl-search-results-table > * > TR > TH[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6) + TH[colspan=""2""]:not([rowspan]):nth-child(2):nth-last-child(5) + TH[colspan=""1""]:not([rowspan]):nth-child(3):nth-last-child(4) + TH[colspan=""2""]:not([rowspan]):nth-child(4):nth-last-child(3) + TH[colspan=""1""]:not([rowspan]):nth-child(5):nth-last-child(2), TABLE.rpl-search-results-table > * > TR > TD[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(2):nth-last-child(5) + TD[colspan=""1""]:not([rowspan]):nth-child(3):nth-last-child(4) + TD[colspan=""2""]:not([rowspan]):nth-child(4):nth-last-child(3) + TD[colspan=""1""]:not([rowspan]):nth-child(5):nth-last-child(2)"}, {"Column9", "TABLE.rpl-search-results-table > * > TR > TH[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6) + TH[colspan=""2""]:not([rowspan]):nth-child(2):nth-last-child(5) + TH[colspan=""1""]:not([rowspan]):nth-child(3):nth-last-child(4) + TH[colspan=""2""]:not([rowspan]):nth-child(4):nth-last-child(3) + TH[colspan=""1""]:not([rowspan]):nth-child(5):nth-last-child(2) + TH[colspan=""2""]:not([rowspan]):nth-child(6):nth-last-child(1), TABLE.rpl-search-results-table > * > TR > TD[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(2):nth-last-child(5) + TD[colspan=""1""]:not([rowspan]):nth-child(3):nth-last-child(4) + TD[colspan=""2""]:not([rowspan]):nth-child(4):nth-last-child(3) + TD[colspan=""1""]:not([rowspan]):nth-child(5):nth-last-child(2) + TD[colspan=""2""]:not([rowspan]):nth-child(6):nth-last-child(1)"}, {"Column10", "TABLE.rpl-search-results-table > * > TR > TH[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6) + TH[colspan=""2""]:not([rowspan]):nth-child(2):nth-last-child(5) + TH[colspan=""1""]:not([rowspan]):nth-child(3):nth-last-child(4) + TH[colspan=""2""]:not([rowspan]):nth-child(4):nth-last-child(3) + TH[colspan=""1""]:not([rowspan]):nth-child(5):nth-last-child(2) + TH[colspan=""2""]:not([rowspan]):nth-child(6):nth-last-child(1), TABLE.rpl-search-results-table > * > TR > TD[colspan=""2""]:not([rowspan]):nth-child(1):nth-last-child(6) + TD[colspan=""2""]:not([rowspan]):nth-child(2):nth-last-child(5) + TD[colspan=""1""]:not([rowspan]):nth-child(3):nth-last-child(4) + TD[colspan=""2""]:not([rowspan]):nth-child(4):nth-last-child(3) + TD[colspan=""1""]:not([rowspan]):nth-child(5):nth-last-child(2) + TD[colspan=""2""]:not([rowspan]):nth-child(6):nth-last-child(1)"}}, [RowSelector="TABLE.rpl-search-results-table > * > TR"]),
#"Changed Type" = Table.TransformColumnTypes(#"Extracted Table From Html",{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}, {"Column9", type text}, {"Column10", type text}})
in
#"Changed Type"

 

 

Any help would be appreciated!

 

Thanks

 

 

 

 

2 REPLIES 2
ImkeF
Community Champion
Community Champion

I would need to study the API documentation to understand the paging mechanism for this page. So please post the link to a description of this service.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Nathaniel_C
Community Champion
Community Champion

Hi @Anonymous , @ImkeF is great at m language!
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.