problem with online quotes/regexps in KMyMoney 5.0.5

Thomas Baumgart thb at net-bembel.de
Tue Aug 6 14:21:27 BST 2019


Jochen,

try SAP:FRA instead of the WKN. The FT service does not provide a lookup by WKN (Wertpapierkennnummer). Then things work as expected.

Regards

Thomas


Hello,

I gave up to get the quotes by analysing the web sites. But I am willing to try it again. Unfortunately it was not successful with your sample.

The part from kmymoneyrc shows:

[Online-Quote-Source-Financial Times]CSVURL=DateFormatRegex=%m %d %yDateRegex=as of (\\w+ \\d+ \\d+) \\d+:\\d+.+T\\.</div>IDBy=0IDRegex=PriceRegex=<span class="mod-ui-data-list__value">([\\d\\.,]+)</span>SkipStripping=trueURL=https://markets.ft.com/data/equities/tearsheet/summary?s=%1

If I use the URL and replace %1 with 716460 (WKN of SAP) I get a search page with thisURL: https://markets.ft.com/data/search?query=716460&assetClass=Equity[1]
thb at net-bembel.de[2]> schrieb:


Geza,
here it comes:
URL: "https://markets.ft.com/data/equities/tearsheet/summary?s=%1[3]"
Symbol: leave empty
Price: "<span class="mod-ui-data-list__value">([\d\.,]+)</span>"
Date: "as of (\w+ \d+ \d+) \d+:\d+.+T\.</div>"
Format: "%m %d %y"
Mark the "Skip HTML stripping" option. If you don't have that marked, it won't work because it verfies against some HTML tags and those will otherwise be removed.
Don't include the surrounding quotes I have used in the values above. I just added them for better readability.
Here's the output of the onlinequoteseditor from Alkimia:
*URL found: https://markets.ft.com/data/equities/tearsheet/summary?s=PFE:FRA[4]...*
*Symbol found: ''*
*Price found: '33.20' (33.2)*
*Date found: 'Aug 05 2019'*
*Date format found: 'Aug 05 2019' -> 'Mo. Aug. 5 2019'*
PFE:FRA PFE:FRA Mo. Aug. 5 2019 33.2
Hope that also works for you. Oh, and the double quotes: that only applies if you enter the strings as C/C++ source code but not to the edit fields in the application.
Regards
Thomas
On Samstag, 3. August 2019 19:41:16 CEST Geza Giedke wrote:
> Hello,
>
> after an upgrade from 4.8.2. to 5.0.5 (while moving from openSUSE 42.3
> to 15.1) my online quotes do not work anymore ("Unable to update price
> for PFE.FRA (no price or no date)") nor can I get any of the default
> sites for quotes to work.
>
> There must be some mistake in the regexps I'm using, but I can't find
> it (and when I tried them out at the RegExp tester
> (http://myregexp.com[5]) they did work. Any help would be appreciated.
> Maybe someone on this list can spot the mistake - I would be very
> grateful.
>
> I would like to continue using the data provided by FT, e.g.,
> https://markets.ft.com/data/equities/tearsheet/summary?s=PFE:FRA[4]
>
> The page contains the price in the form
>
> Price (EUR)</span><span class="mod-ui-data-list__value">34.40</span>
>
> which I used to to match with
>
> Price\\s\\(\\w+\\)</span><span
> class="mod-ui-data-list__value">(\\d?\\,?\\d+\\.\\d+)</span>
>
> (I used double \\ because of the explanation "To include a \ in a
> regexp, enter it twice, i.e. \\. To match the backslash character
> itself, enter it four times, i.e. \\\\." given on the QtRegExp-Help
> page (https://doc.qt.io/archives/qt-4.8/qregexp.html#code-examples[6]),
> but I also tried out several variants of the above without doubling
> the backslashes (since the default entries in KMyMoney use single
> slashes only) such as:
>
> Price \(EUR\)</span><span class="mod-ui-data-list__value">([\d, ]+\.\d+)
>
> but the result is always the same. To see that I can match at least
> something, I tried
>
> utf-(\d)
>
> which then indeed gives "8" -- the only "expected" result I could produce.
>
> The date comes as
>
> as of Aug 02 2019 17:04 BST.</div>
>
> which I used to match with
>
> as of (\\w+\\s\\d+\\s\\d+)\\s\\d+:\\d+\\sBST
>
> or with
>
> as of (\w+ \d+ \d+)
>
> But now I always get "(no price or no date)". What am I doing wrong?
>
> The new KMyMoney also seems to require to extract the identifier from
> the file (which seems weird since it's already used to identify the
> file); I use
>
> /data/equities/tearsheet/charts\?s=(\w+:\w+)
>
> for this; when I leave the corresponding line empty The response
> changes slightly, including also a "Identifier found: ''"
> before the "(no price or no date)" line.
>
> Is there some way in which I can see/debug how the RegExp I'm using is
> being matched?
>
> Thanks a lot for your time and help.
>
> best regards
> Geza
>
--
Regards
Thomas Baumgart
https://www.signal.org[7] Signal, the better WhatsApp
-------------------------------------------------------------
Why do programmers wear glasses?
Cause they don't C#.
-------------------------------------------------------------




-- 

Regards

Thomas Baumgart

https://www.signal.org/       Signal, the better WhatsApp
-------------------------------------------------------------
Adam and Eve: the first people to not
read the Apple terms and conditions.
-------------------------------------------------------------


--------
[1] https://markets.ft.com/data/search?query=716460&assetClass=Equity
[2] mailto:thb at net-bembel.de?to=%22Thomas%20Baumgart%22%20<thb at net-bembel.de>
[3] https://markets.ft.com/data/equities/tearsheet/summary?s=%1
[4] https://markets.ft.com/data/equities/tearsheet/summary?s=PFE:FRA
[5] http://myregexp.com/
[6] https://doc.qt.io/archives/qt-4.8/qregexp.html#code-examples
[7] https://www.signal.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kmymoney/attachments/20190806/1388d248/attachment-0001.html>
-------------- 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/20190806/1388d248/attachment-0001.sig>


More information about the KMyMoney mailing list