joseballester / muFunds

µFunds lets you import your asset data from Morningstar and other sources to your Google Sheets spreadsheet by using a simple formula.
https://mufunds.com
81 stars 11 forks source link

Morningstar-gb no longer a useable source #43

Closed milltownham closed 2 years ago

milltownham commented 2 years ago

Trying to use morningstar-gb as a source for one of my mutual funds (GB00B6QQ9X96) and it returns an error on line 103 of I think morningstar-country.js. Also for some reason the error message is in Spanish: ‘TypeError: No se puede llamar al método “toXmlString” de undefined. (line 103).

mattjgalloway commented 2 years ago

Same issue.

@joseballester do you still maintain muFunds? I would potentially be interested in helping out if you need support? I can start taking a look into this issue at least if that would be appreciated?

mattjgalloway commented 2 years ago

https://github.com/mattjgalloway/muFunds/commit/865bf9585ba823e7987fec01b1dc34e770d189eb

This is my WIP. It's a big commit and I'll try to break it up a bit.

joseballester commented 2 years ago

Hi @mattjgalloway, thanks for reaching out and taking the lead on this issue! I've been a bit busy lately, but I'd definitely like continue maintaining muFunds. Of course, your help would be very appreciated as well.

I've been looking for alternatives to the Xml service for a while. One of the reasons was Google's deprecation of Rhino and migration to the V8 runtime, but also that using XML parsing for HTML was reporting many errors and therefore some "pre-parsing" was necessary (removing scripts or some non-standard attributes or tags).

The immediate option was migrating to XmlService from V8, but it wasn't working as expected and I didn't have time to look into that more deeply. Your suggestion of using an external library such as cheerio makes a lot of sense.

Would you like to prepare a PR with your changes, or would you prefer me doing it based on your commit? (Of course, in both cases the credit would be yours.)

Thanks a lot again!

mattjgalloway commented 2 years ago

@joseballester No worries! I've just put up #44 for this.

I've tested it with my own simple spreadsheet but I guess you'll want to test it much more thoroughly!

vaaggarwal1 commented 2 years ago

Hi @joseballester I'm getting the same issue on morningstar-gb. Was the https://github.com/joseballester/muFunds/pull/44 merged into master and made public?

jacklangman commented 2 years ago

morningstar-uk and -gb are no longer recognised as valid sources at all and generate:

TypeError: No se puede llamar al método "toXmlString" de undefined. (line 103).

A workaround for many funds is to change ISINs (which seem broken for country specific lookups) to morningstar ids and use -ie which seems better than -lu for coverage of UK stuff but there are a lot of mainstream funds that are not registered anywhere other than in the UK, and have no alternative unit classes for different geographies/currencies

Is this issue still recognised as live?

Here is an example fund morningstar id

3ABLRZYX5 Matthews Asia Small Companies

joseballester commented 2 years ago

Hi @vaaggarwal1 and @jacklangman. After having some issues when publishing to the Google Workspace Marketplace, I've managed to deploy the latest updates (including #44). Could you please check if it works now for you?

@jacklangman: Regarding the fund you were referring to, could you please let me know the ISIN of the fund or try if it now works? Thanks!

jacklangman commented 2 years ago

Thanks, Jose

Still no joy for me, I'm afraid Here's an example, morningstar id / ISIN

T Rowe Price China Evolution 3ABMHRMM3 | GB00BMHRMM32

joseballester commented 2 years ago

@jacklangman It should be working with the latest version. Please make sure you are using the ISIN (GB00BMHRMM32) or the correct Morningstar ID (F00001D608). See the URL to understand where the Morningstar ID comes from:

https://www.morningstar.co.uk/uk/funds/snapshot/snapshot.aspx?id=F00001D608

Please let me know if it works when you use either of the values above. Thanks!

jacklangman commented 2 years ago

@jacklangman It should be working with the latest version. Please make sure you are using the ISIN (GB00BMHRMM32) or the correct Morningstar ID (F00001D608). See the URL to understand where the Morningstar ID comes from:

https://www.morningstar.co.uk/uk/funds/snapshot/snapshot.aspx?id=F00001D608

Please let me know if it works when you use either of the values above. Thanks!

I'm very sorry. It DOES work. Thank you

I tested it in an overly complex spreadsheet and it took a couple of reloads but now pulls through from the ISIN

Hugely appreciated!

joseballester commented 2 years ago

@jacklangman Happy to hear that!

I'll close this issue, as it seems it has been solved. Please feel free to open a new issue if not!