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

Catastrophic Failure OR WebView2 runtime error when using blank query (Source = Web.BrowserContents)

I am trying to use Microsoft Fabric (Trial Lisence) Dataflow Gen2 to Get Data (a webscrape) but it either gives me a Catastrophic Error Failure or it complains that WebView2 is not installed even when it is. I have done this both via my local PC using Edge and an Azure VM to rule out it is not a local setting. I have done repairs to both WebView2 and Edge but nothing seems to work. I would like to see if others are getting the same issue as me? (Sidenote - I can do the below in Power BI desktop no issues so it is not the query or the site)
1. Log into https://app.fabric.microsoft.com go to the (Synapse) Data Engineering experience and create a Lakehouse (preview). Go into that Lakehouse and choose New Dataflow Gen2 (preview): 

wazdarocsta_0-1689575686455.png

2.  Choose Get data > Blank query - replace the query text with the following code choose a gateway and hit Next:

let
    Source = Web.BrowserContents("https://www.parkrun.co.za/delta/results/latestresults/"),
    #"Extracted Table From Html" = Html.Table(Source, {{"POSITION", ".Results-table-td\-\-position"}, {"PARKRUNNER", ".Results-table-td\-\-name > .compact"}, {"RUNNERDETAILURL", "[target=""_top""]", each [Attributes][href]?}}, [RowSelector=".Results-table-row"]),
    #"Changed Type" = Table.TransformColumnTypes(#"Extracted Table From Html",{{"POSITION", Int64.Type}, {"PARKRUNNER", type text}, {"RUNNERDETAILURL", type text}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each [PARKRUNNER] <> "Unknown"),
    #"Kept First Rows" = Table.FirstN(#"Filtered Rows",5)
in
    #"Kept First Rows"

3. It will pop up an alert "We could not evaluate this query due to invalid or missing credentials." Click on Configure Connection 

wazdarocsta_2-1689575685923.png

4. Because it is public www and the Authentication kind defaults to Anonymous you can simply hit Connect: 

5a. Error: "We encountered an error when initializing the web browser. Details Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

5b. Other times it has shown me error message: 

We were unable to find the WebView2 runtime. You can manually download the runtime installer here: https://go.microsoft.com/fwlink/p/?LinkId=2124703

When I go to the link and try install Webview2 it tells me that it is already installed. 

 

All of this is very frustrating and means I cannot achieve what I need to using Fabric until this issue is fixed.  

 

6. Show details: (text below): 

---------- Message ----------
We encountered an error when initializing the web browser.

---------- Session ID ----------
339fd36e-bb5c-4ae2-900c-619c84e5dbd4

---------- Request ID ----------
82e828a5-f96d-493a-bbd9-2d2cbac390c4

---------- Mashup script ----------
[DefaultOutputDestination = "DefaultDestination"]
section Section1;
shared DefaultDestination = Lakehouse.Contents(null){[workspaceId = "8401d000-b3c6-40e7-8ebf-b86c192e047b"]}[Data]{[lakehouseId = "be7ddef0-ae31-4ef5-9062-5543ad6fac70"]}[Data];
[BindToDefaultOutputDestination = true]
shared Query = let
Source = Web.BrowserContents(" https://www.parkrun.co.za/delta/results/latestresults/"),
#"Extracted Table From Html" = Html.Table(Source, {{"POSITION", ".Results-table-td\-\-position"}, {"PARKRUNNER", ".Results-table-td\-\-name > .compact"}, {"RUNNERDETAILURL", "[target=""_top""]", each [Attributes][href]?}}, [RowSelector=".Results-table-row"]),
#"Changed Type" = Table.TransformColumnTypes(#"Extracted Table From Html",{{"POSITION", Int64.Type}, {"PARKRUNNER", type text}, {"RUNNERDETAILURL", type text}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each [PARKRUNNER] <> "Unknown"),
#"Kept First Rows" = Table.FirstN(#"Filtered Rows",5)
in
#"Kept First Rows"; 

Status: Delivered
Comments
Anonymous
Not applicable

Hi @wazdarocsta ,

 

Would it help to configure the gateway for this web datasource first and then retry?

 

Best regards.
Community Support Team_Caitlyn

wazdarocsta
Regular Visitor

Hi @Anonymous Caitlyn & Microsoft Community Support Team

Thanks for the response. It's not the gateway, we do have a gateway (correctly configured) and one of my colleagues can actually do this but myself and other colleagues can't, and this is using the same VM or our local machines.

 

Basically if you follow the steps I have laid out above are YOU able to do it? There is defintely something preventing some from being able to do it and others not to.

 

Please let me know if you require any further info. I would love to be able to assist your team in pinpointing the root cause of this issue and resolving it. Thanks, Warren

straitmstrsoh
Regular Visitor

We have this same issue. We have Webview2 and the latest Gateway version installed no our on-premises server. We have a Web.BrowserContents Dataflow to create an entity that was working until the Upgrade to the latest version of the Gateway. After the upgrade and installation of Webview2 we get the error. Error and Power Query below. 

We encountered an error when initializing the web browser.

Details
Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

 

let
    Source = Web.BrowserContents("https://www.strsoh.org/employer/education/webinars/"),
    // Get the data from the table on the web site.
    #"Extracted Table From Html" = Html.Table(Source, {{"Column1", ".info A"}, {"Column2", ".name + *"}, {"Column3", ".date"}, {"Column4", "SPAN:nth-child(2) *"}}, [RowSelector = ".content-links LI"]),
    // Sept. is the standard for associated press and needs fixed and set to Sep. so that it can be parsed properly.
    #"Replaced Value for Sept." = Table.ReplaceValue(#"Extracted Table From Html", "Sept.", "September", Replacer.ReplaceText, {"Column3"}),
    // Need the Column3 to be a datetime.
    #"Changed Type to Date" = Table.TransformColumnTypes(#"Replaced Value for Sept.", {{"Column1", type text}, {"Column2", type text}, {"Column3", type datetime}, {"Column4", type text}}),
    // Put the correct names on the column headers.
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type to Date", {{"Column1", "Training Name"}, {"Column3", "As of Date"}}),
    // The extra 2 columns can be removed at this point.
    #"Removed Columns" = Table.RemoveColumns(#"Renamed Columns", {"Column4", "Column2"}),
    // Need to set the name column.
    #"Added Training Name" = Table.AddColumn(#"Removed Columns", "Training Type", each "On-Demand Webinar"),
    // Type is always 3 for On-Demand Webinars.
    #"Added Training Type" = Table.AddColumn(#"Added Training Name", "TrainingTypeID", each 3),
    // Change Type to Text and TypeID to integer.
    #"Changed Types" = Table.TransformColumnTypes(#"Added Training Type", {{"TrainingTypeID", Int64.Type}, {"Training Type", type text}}),
    #"On-Demand Webinars (Web Site Scrape)-4173206F662044617465-autogenerated_for_incremental_refresh" = Table.SelectRows(#"Changed Types", each DateTime.From([#"As of Date"]) >= RangeStart and DateTime.From([#"As of Date"]) < RangeEnd)
in
    #"On-Demand Webinars (Web Site Scrape)-4173206F662044617465-autogenerated_for_incremental_refresh"
straitmstrsoh
Regular Visitor

I worked with Microsoft. Based on their recommendation I have replaced Web.BrowserContents with Web.Contents in the first line of M-query and it resolved the issue. For those who still have the issue give that a try.

Anonymous
Not applicable

Thank you for the sharing from straitmstrsoh, for other users with similar experiences you can check the comments below. This thread will now be closed.

 

Best regards.
Community Support Team_ Caitlyn

wazdarocsta
Regular Visitor

Thanks - so I did try with Web.Contents instead of Web.BrowserContents. I do not get the error anymore, but I also do not get any data - ?This table has no rows.

 

I tried using this query in PowerBI and both Web.Contents instead of Web.BrowserContents work. 

watts_jim
Helper II

We have the same issue with Web.BrowserContents, and Web.Contents returns nothing.  Any progress on this please ?

wazdarocsta
Regular Visitor

@watts_jim ah man sorry to hear you are also experiencing this. No resolution was ever reached or given. That project as shelved and put into the Microsoft unresolved issues graveyard where the majority of my unfinished projects lie. Unfortunately once my minimum viable product approach fails and I can't provide a prood of concept I move on .. I can't allow for unlimited time and effort to be spent on things that can and should work but don't. I hope it does get resolved but until I get a resolution or at least a cause I'm not holding my breath. Good luck!