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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

I can't schedule refresh for a web dataset with multiple pages. Problem in the Web.Contents function

Hi there,

 

I created a query to get data from the web with multiple pages. The query works fine and updates through PowerBI desktop. However, when I try to schedule a refresh I get the following message:

 

"You can't schedule refresh for this dataset because the following data sources currently don't support refresh:

  • Data source for Query1

 

Discover Data Sources

Query contains unsupported function. Function name: Web.Contents"

 

I am not sure what is going wrong, I have been looking for previous solutions but they don't seem to work for the multiple pages problem.

 

Here is the Query I am using (I adapted the URL to be able to post it here):

 

(URL) =>

let
Source = Web.Page(Web.Contents(URL)),
Data0 = Source{0}[Data],
#"Changed Type" = Table.TransformColumnTypes(Data0,{{"Rk", Int64.Type}, {"", type text}, {"Name", type text}, {"Team", type text}, {"Overall Age", Int64.Type}, {"Overall Pos", type text}, {"Overall GP", Int64.Type}, {"Overall G", Int64.Type}, {"Overall A", Int64.Type}, {"Overall P", Int64.Type}, {"Overall PIM", Int64.Type}, {"Overall +/-", Int64.Type}, {"Goals ESG", Int64.Type}, {"Goals PPG", Int64.Type}, {"Goals SHG", Int64.Type}, {"Goals GWG", Int64.Type}, {"Goals OTG", Int64.Type}, {"Assists ESA", Int64.Type}, {"Assists PPA", Int64.Type}, {"Assists SHA", Int64.Type}, {"Assists GWA", Int64.Type}, {"Assists OTA", Int64.Type}, {"Points ESP", Int64.Type}, {"Points PPP", Int64.Type}, {"Points SHP", Int64.Type}, {"Points GWP", Int64.Type}, {"Points OTP", Int64.Type}, {"Points PPP%", Percentage.Type}, {"Time on Ice TOI", type text}, {"Time on Ice ES", type time}, {"Time on Ice PP", type time}, {"Time on Ice SH", type time}, {"per 60 All Situations G/60", type number}, {"per 60 All Situations A/60", type number}, {"per 60 All Situations P/60", type number}, {"per 60 Even-Strength ESG/60", type number}, {"per 60 Even-Strength ESA/60", type number}, {"per 60 Even-Strength ESP/60", type number}, {"per 60 Power-Play PPG/60", type number}, {"per 60 Power-Play PPA/60", type number}, {"per 60 Power-Play PPP/60", type number}, {"per Game G/GP", type number}, {"per Game A/GP", type number}, {"per Game P/GP", type number}, {"Shots SHOTS", Int64.Type}, {"Shots SH%", Percentage.Type}, {"Defensive HITS", Int64.Type}, {"Defensive BS", Int64.Type}, {"Faceoffs FOW", Int64.Type}, {"Faceoffs FOL", Int64.Type}, {"Faceoffs FO%", Percentage.Type}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Overall PIM", "Overall +/-", "Goals ESG", "Goals PPG", "Goals SHG", "Goals GWG", "Goals OTG", "Assists ESA", "Assists PPA", "Assists SHA", "Assists GWA", "Assists OTA", "Points ESP", "Points PPP", "Points SHP", "Points GWP", "Points OTP", "Points PPP%", "Time on Ice TOI", "Time on Ice ES", "Time on Ice PP", "Time on Ice SH", "per 60 All Situations G/60", "per 60 All Situations A/60", "per 60 All Situations P/60", "per 60 Even-Strength ESG/60", "per 60 Even-Strength ESA/60", "per 60 Even-Strength ESP/60", "per 60 Power-Play PPG/60", "per 60 Power-Play PPA/60", "per 60 Power-Play PPP/60", "per Game G/GP", "per Game A/GP", "per Game P/GP", "Shots SHOTS", "Shots SH%", "Defensive HITS", "Defensive BS", "Faceoffs FOW", "Faceoffs FOL", "Faceoffs FO%", "Overall Age", "Overall Pos"})
in
#"Removed Columns"

 

let
Source = {1..Page},
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type text}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "Page_ID"}}),
#"Added Custom" = Table.AddColumn(#"Renamed Columns", "Page_URL", each "https://www.quanthockey.com/scripts/AjaxPaginate.php?cat=Season&pos=Players&SS=2019-20&af=0&nat=2019..."),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Page_URL", type text}}),
#"Invoked Custom Function" = Table.AddColumn(#"Changed Type1", "All_Pages_Scrapper", each Web_Scrapper([Page_URL])),
#"Removed Errors" = Table.RemoveRowsWithErrors(#"Invoked Custom Function", {"All_Pages_Scrapper"}),
#"Expanded All_Pages_Scrapper" = Table.ExpandTableColumn(#"Removed Errors", "All_Pages_Scrapper", {"Rk", "", "Name", "Team", "Overall GP", "Overall G", "Overall A", "Overall P"}, {"Rk", "Column1", "Name", "Team", "Overall GP", "Overall G", "Overall A", "Overall P"}),
#"Removed Columns" = Table.RemoveColumns(#"Expanded All_Pages_Scrapper",{"Page_ID", "Page_URL"}),
#"Changed Type2" = Table.TransformColumnTypes(#"Removed Columns",{{"Rk", Int64.Type}, {"Column1", type text}, {"Name", type text}, {"Team", type text}, {"Overall GP", Int64.Type}, {"Overall G", Int64.Type}, {"Overall A", Int64.Type}, {"Overall P", Int64.Type}}),
#"Renamed Columns1" = Table.RenameColumns(#"Changed Type2",{{"Column1", "Country"}})
in
#"Renamed Columns1"

 

 

Thank you very much for your help!

 

 

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

You may refer to this blog to see if it could help you:

https://blog.crossjoin.co.uk/2016/08/23/web-contents-m-functions-and-dataset-refresh-errors-in-power-bi/

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

You may refer to this blog to see if it could help you:

https://blog.crossjoin.co.uk/2016/08/23/web-contents-m-functions-and-dataset-refresh-errors-in-power-bi/

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you for your reply, I tried following his steps but nothing yet... It could be that I am missing something as well, so I will accept your answer! 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors