regex to fetch price and date
Thomas Baumgart
thb at net-bembel.de
Sat Sep 5 16:31:03 BST 2020
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
-------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kmymoney/attachments/20200905/8fca12ca/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 868 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kmymoney/attachments/20200905/8fca12ca/attachment.sig>
More information about the KMyMoney
mailing list