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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mussol_
Advocate II
Advocate II

NO REFRESH FROM WEB PAGE

Hello,

 

since a couple of weeks ago, the data I obtained from a web page returns an error, I tried this with several web origins with same result.

The error that appears is:

"We timed out waiting for the web page to load."

 

The URL is, for example: https://www.expansion.com/mercados/cotizaciones/indices/ibex35_I.IB.html

You can confirm that the web page can be loaded correctly from a web browser.

 

The code from Power Query is:

let
Origen = Web.BrowserContents("https://www.expansion.com/mercados/cotizaciones/indices/ibex35_I.IB.html"),
#"Tabla extraída a partir de HTML" = Html.Table(Origen, {{"Column1", "TABLE[id='listado_valores'] > * > TR > :nth-child(1)"}, {"Column2", "TABLE[id='listado_valores'] > * > TR > :nth-child(2)"}, {"Column3", "TABLE[id='listado_valores'] > * > TR > :nth-child(3)"}, {"Column4", "TABLE[id='listado_valores'] > * > TR > :nth-child(4)"}, {"Column5", "TABLE[id='listado_valores'] > * > TR > :nth-child(5)"}, {"Column6", "TABLE[id='listado_valores'] > * > TR > :nth-child(6)"}, {"Column7", "TABLE[id='listado_valores'] > * > TR > :nth-child(7)"}, {"Column8", "TABLE[id='listado_valores'] > * > TR > :nth-child(8)"}, {"Column9", "TABLE[id='listado_valores'] > * > TR > :nth-child(9)"}, {"Column10", "TABLE[id='listado_valores'] > * > TR > :nth-child(10)"}, {"Column11", "TABLE[id='listado_valores'] > * > TR > :nth-child(11)"}}, [RowSelector="TABLE[id='listado_valores'] > * > TR"]),
#"Encabezados promovidos" = Table.PromoteHeaders(#"Tabla extraída a partir de HTML", [PromoteAllScalars=true]),
#"Tipo cambiado" = Table.TransformColumnTypes(#"Encabezados promovidos",{{"Hora", type date}}),
#"Otras columnas quitadas" = Table.SelectColumns(#"Tipo cambiado",{"Valor", "Último", "Hora"}),
#"Columnas con nombre cambiado" = Table.RenameColumns(#"Otras columnas quitadas",{{"Valor", "Nombre"}, {"Último", "ULTIMO"}, {"Hora", "Fecha"}}),
#"Filas filtradas" = Table.SelectRows(#"Columnas con nombre cambiado", each ([Nombre] = "BANKINTER" or [Nombre] = "BBVA" or [Nombre] = "FLUIDRA" or [Nombre] = "IAG" or [Nombre] = "IBERDROLA" or [Nombre] = "REDEIA" or [Nombre] = "SANTANDER" or [Nombre] = "TELEFÓNICA")),
#"Valor reemplazado" = Table.ReplaceValue(#"Filas filtradas","REDEIA","R.E.C.",Replacer.ReplaceText,{"Nombre"}),
#"Valor reemplazado1" = Table.ReplaceValue(#"Valor reemplazado","SANTANDER","B.SANTANDER",Replacer.ReplaceText,{"Nombre"}),
#"Tipo cambiado1" = Table.TransformColumnTypes(#"Valor reemplazado1",{{"ULTIMO", type number}}),
#"Valor reemplazado2" = Table.ReplaceValue(#"Tipo cambiado1","TELEFÓNICA","TELEFONICA",Replacer.ReplaceText,{"Nombre"})
in
#"Valor reemplazado2"

 

Why it worked before and not now?

 

any suggestion?

 

Thanks a lot in advance!

 

Josep.

 

 

1 ACCEPTED SOLUTION
foodd
Super User
Super User

Hello @mussol_ .   The site connected without issue.  Your query processes cleanly until Column "Hora" in the 4th applied step

 

foodd_1-1696106101779.png

 

errored when trying to handle it as a type of Date.   Once the datatype was set to Text, the rest of the script

loaded without issue. 

 

foodd_0-1696105968479.png

 

View solution in original post

2 REPLIES 2
mussol_
Advocate II
Advocate II

It Works!!

Thanks a lot foodd!!

foodd
Super User
Super User

Hello @mussol_ .   The site connected without issue.  Your query processes cleanly until Column "Hora" in the 4th applied step

 

foodd_1-1696106101779.png

 

errored when trying to handle it as a type of Date.   Once the datatype was set to Text, the rest of the script

loaded without issue. 

 

foodd_0-1696105968479.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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