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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
user_none
New Member

M-editor using excel as a reference for web

hi!

 

i have 50 similar web direction i need to scrap, the list is in a excel file

in the M editor it look like this

 

 

 

 

let
    Origen = Web.Page(Web.Contents("https://es.finance.yahoo.com/quote/ANTARCHILE.SN/history?period1=946944000&period2=1632268800&interval=1d&filter=history&frequency=1d&includeAdjustedClose=true")),
    Data0 = Origen{0}[Data],
    #"Tipo cambiado" = Table.TransformColumnTypes(Data0,{{"Fecha", type text}, {"Abrir", type text}, {"Máx.", type text}, {"Mín.", type text}, {"Cierre*", type text}, {"Cierre ajus.**", type text}, {"Volumen", type text}})
in
    #"Tipo cambiado"

 

 

 

 So my question is, there is  a way to guide the m editor through the 50 similar web directions using the excel as a reference?

the first will be :

https://es.finance.yahoo.com/quote/ANTARCHILE.SN/history?period1=946944000&period2=1632268800&interv...

and is the B1 in Excel

i want to put the second as B2 , the third as B3 and so on

1 REPLY 1
KNP
Super User
Super User

Hi @user_none,

 

You may run into some challenges if they're only "similar" but you could try some variation of this...

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("PczdCoIwGMbxe/EC3EcyNBghEhSEB9WZeSDbay7WpvsIvPsKrdPf8/BvmmQIYfRbhHplOiMgnbvB2lTYJ5qiDYDK+lqeq8PxtE8vNRqUD9bNuxGcspLwImNFlmGMbxFjyhamnLANpSzPf65MAPfqNCdygV7pj/A1t5qDKYIR8/+ljNBRQikf0QeQlbYeeHARlvkehbDxm+Ykads3", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [address = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"address", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Web.Page(Web.Contents([address]))),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each Table.First([Custom])),
    #"Expanded Custom.1" = Table.ExpandRecordColumn(#"Added Custom1", "Custom.1", {"Data"}, {"Data"}),
    #"Expanded Data" = Table.ExpandTableColumn(#"Expanded Custom.1", "Data", {"Date", "Open", "High", "Low", "Close*", "Adj Close**", "Volume"}, {"Date", "Open", "High", "Low", "Close*", "Adj Close**", "Volume"})
in
    #"Expanded Data"

 

Just replace the source with your Excel data if it works for you.

 

Kim

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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