regex to fetch price and date

Andy Chung andy.chung.0 at gmail.com
Sat Sep 5 17:04:40 BST 2020


could see the stated fund in FT which KMM should support out of the box ...
just add symbol: IT0005385262:EUR
using source: Financial Times

https://markets.ft.com/data/funds/tearsheet/summary?s=IT0005385262:EUR

Franco Martelli <martellif67 at gmail.com> 于2020年9月5日周六 下午11:51写道:

> On 05/09/20 at 17:31, Thomas Baumgart wrote:
> >
> >
> >
> >
> > On Samstag, 5. September 2020 17:05:40 CEST Franco Martelli wrote:
> >
> >
> >
> >> Sorry, the right web page address is:
> >
> >>
> >
> https://my.consultinvest.it/servizi/quote_fondi_sgr_pubblico.asp?path=offerta%2f
> >
> >
> >
> > OK, let's give it a try:
> >
> >
> >
> > The date can be found in the following construct:
> >
> >
> >
> > <div class="mb10">Quote dei fondi Consultinvest Asset Management SGR al
> > <b>02/09/2020</b><input id="sdinput" n
> >
> >
> >
> > so the date regex would be:
> >
> >
> >
> > al <b>\d{2}/\d{2}/\d{4}</b>
> >
> >
> >
> > you may replace the '\' with a dot which would allow 'any' character in
> > that position. But the bold start and
> >
> > end tag have to be part of the regex.
> >
> >
> >
> > The price is a lot more complex as it is spread over multiple lines.
> >
> >
> >
> > <tr>
> >
> > <td>IT0005385262</td>
> >
> > <td>Consultinvest Mosaico - Fondo Etico classe C</td>
> >
> > <td class="text-right">4,984</td>
> >
> > </tr>
> >
> >
> >
> > and I am not sure if KMyMoney does support that. You could try:
> >
> >
> >
> >>IT0005385262</td>\n.+\n.+>(([\d.]+,\d+)<
> >
> >
> >
> > to include the line breaks. An important setting is the mark the "Skip
> > HTML stripping".
> >
> >
> >
> > This also only works for that one investment since this page provides
> > multiple. I will
> >
> > add a feature request to allow the identifier to be part of the regex
> > for such cases.
> >
> >
> >
> > Hope that helps.
> >
> >
> >
> >
> >
> > --
> >
> >
> >
> > Regards
> >
> >
> >
> > Thomas Baumgart
> >
> >
> >
> > https://www.signal.org/ Signal, the better WhatsApp
> >
> > -------------------------------------------------------------
> >
> > Ilde servers are the devil's work -- robbyoconnor on #irc
> >
> > -------------------------------------------------------------
> >
> >
> >
>
> Thanks Thomas, I've just send an email that explain what I did to fetch
> date and price it worked without mark "Skip HTML stripping".
> Now I'm struggling with another fund I'm trying to find a good web
> source the problem is that the Fund is on Yahoo Finance but date and
> price are not updated! I don't know why...
> Maybe I will write again to the mailing list as last resort
> Kind regards
> --
> Franco Martelli
>


-- 
Cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kmymoney/attachments/20200906/b91b8f9d/attachment.htm>


More information about the KMyMoney mailing list