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.
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.
Solved! Go to Solution.
Hello @mussol_ . The site connected without issue. Your query processes cleanly until Column "Hora" in the 4th applied step
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.
It Works!!
Thanks a lot foodd!!
Hello @mussol_ . The site connected without issue. Your query processes cleanly until Column "Hora" in the 4th applied step
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
96 | |
79 | |
67 | |
62 |
User | Count |
---|---|
137 | |
106 | |
104 | |
81 | |
63 |