Forum Discussion

maasool's avatar
maasool
Helper I
3 years ago
Solved

Query info from web not in a table

Is there any way to query the latest stock price from this web page? https://www.gettex.de/en/gettex-die-schnelle-und-guenstige-boerse/?isin=IE00B4WXJH41&name=ishares-eur-govbd10-15yr-ueeur-d&token=4...
  • BA_Pete's avatar
    3 years ago

    Hi maasool ,

     

    You need to find the current value using the "Get from examples" option, then PQ writes the HTML location for you:

    let
        Source = Web.BrowserContents("https://www.gettex.de/en/gettex-die-schnelle-und-guenstige-boerse/?isin=IE00B4WXJH41&name=ishares-eur-govbd10-15yr-ueeur-d&token=4f37389707b01bef874ca4d47e99bf80"),
        extractPriceHTML = Html.Table(Source, {{"Column1", ".stock-details > DIV > :nth-child(2)"}}),
        addGetNumerical = Table.AddColumn(extractPriceHTML, "getNumerical", each Text.Select([Column1], List.Combine({{"0".."9"}, {","}}))),
        chgTypeWithLocale = Table.TransformColumnTypes(addGetNumerical, {{"getNumerical", type number}}, "de-DE")
    in
        chgTypeWithLocale

     

    Example query output:

     

    I've done a bit of formatting to get the output into my regional format ("." instead of ","), but once you get the value into PQ, you can do whatever you want with it.

     

    Pete