Automatic import of classifications

Hi @Alfons1Qvor12 . I tried to follow your instructions to use the most current main branch version but I’m struggling to get a valid auth token.

As described I opened a page like https://global.morningstar.com/en-eu/investments/etfs/0P0000ONBH/portfolio but I couldn’t find the fragment you mentioned (<sal-components data-v-a...)in the HTML code in order to retrieve the access token. What am I missing here? Thanks!

Hi @tbx,

Look for access-token.

Not sure how you look at the html.
The relevant part is in body, but sometimes it helps to search from top level (html).

On the page which you linked, it actually says:
<sal-components class="investment-quote__sal-container__mdc undefined" data-v-43f863ae="" access-token="...

@Alfons1Qvor12 Oh my, I was just too stupid… I was looking at the page content inside the DevTools instead of just simply saving the rendered HTML! All good now, I got the access token and it worked like a charm!

@Alfons1Qvor12 Some small findings with your latest version:

  1. For the Amundi Nasdaq-100 II UCITS ETF Dist (LU2197908721 / SecId 0P0001NH7B) I get the following warnings and no classifications are added/updated. I double checked that the SecId is correct and also re-tried a couple of times.

    [Amundi Nasdaq-100 II UCITS ETF Dist]
    Warning: Problem with Asset Type for secid 0P0001NH7B in PortfolioSAL…
    Warning: Problem with Stock Sector for secid 0P0001NH7B in PortfolioSAL…
    Warning: Problem with Region for secid 0P0001NH7B in PortfolioSAL…
    Warning: Problem with Country for secid 0P0001NH7B in PortfolioSAL…
    Warning: percentages not found for Holding for 0P0001NH7B

  2. Same for ARERO-DER WELTFONDS (LU0360863863 / SecID 0P0000IKJL). I remember from our previous discussions that this specifc fond is sort of special…

    [ARERO-DER WELTFONDS INH.]
    Warning: Problem with Asset Type for secid 0P0000IKJL in PortfolioSAL…
    Warning: Problem with Stock Sector for secid 0P0000IKJL in PortfolioSAL…
    Warning: Problem with Region for secid 0P0000IKJL in PortfolioSAL…
    Warning: Problem with Country for secid 0P0000IKJL in PortfolioSAL…
    Warning: percentages not found for Holding for 0P0000IKJL

  3. I noticed there a ever so slightly differences between the numbers shown on the Morningstar website and within PortfolioPerformance after the update. This doesn’t bug me at all, I’m just curious if this is due to some rounding errors?
    E.g. LU0908500753:


    vs

Thanks again!

About 1: I don’t know why some SECIDs work and some not. You might need to try values from different stock exchanges. 0P0001KP94 works for me for LU2197908721 (without Holdings).

About 2: For some funds, the SECIDs from the URL do not work. Again, I don’t know why. If you watch the web page’s network traffic, you see that it gets the information from hidden SECIDs. In this particular case, it currently uses F00000289N for ARERO and it works for me (but I have the impression that these hidden SECIDs are sometimes changing).

About 3.: LU0908500753 contains 99.75% equity (“Stocks”). The rest is “Others”. The table on the web site tells you how these 99.75% are distributed to regions (values in table summing up to 100%). The values in the tool give you the percentages for the fund as a whole (and sum up to 99,75% or actually 99,73% due to rounding).

This worked very well, again! Thanks a bunch!

Phew, there are so many nuances to this whole classification topic…