Forum Discussion

Mehay's avatar
Mehay
Helper I
6 years ago
Solved

Dynamic Date and element in Power BI URL

Hi everyone,    Plz help me on this.   1. I'm trying to format my URL in the way that it takes 2-3 days prior data I found out that this code (below) will work for today, but how do I change it ...
  • camargos88's avatar
    camargos88
    6 years ago

    Mehay ,

     

    Yes, it's like a macro in Excel.

    It keeps all the steps and apply them when the refresh happens.

  • camargos88's avatar
    camargos88
    6 years ago

    Hi Mehay ,

     

    We get this error if the page load is slower than the Power Query request, to fix it, use this code:

     

    let
        Source = Web.BrowserContents("https://www.apple.com/covid19/mobility", [WaitFor = [Timeout = #duration(0,0,0,3)]]),
        Extract = Html.Table(
                                Source, 
                                {
                                    {"Link", "#download-card > div.download-button-container > a", each [Attributes][href]}
                                },
                                 [RowSelector="#download-card > div.download-button-container"]
                            ){0}[Link],
        GetData = Csv.Document(Web.Contents(Extract),[Delimiter=",",Encoding=65001, QuoteStyle=QuoteStyle.None])
    in
        GetData

     

    I just added a timer to delay the load of the page in Power Query.