Bug 472423 - Currency update fails for CAD/USD and USD/CAD
Summary: Currency update fails for CAD/USD and USD/CAD
Status: RESOLVED WORKSFORME
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 5.1.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
: 472443 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-07-20 09:12 UTC by Pete
Modified: 2023-08-15 07:37 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pete 2023-07-20 09:12:30 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Tools
2. Update Stock and Currency Prices
3. 

OBSERVED RESULT

Fetching URL https://fx-rate.net/CAD/USD...
Identifier found: 'CAD/USD'
Date found: 'Thu Jul 20 2023'
Unable to update price for CAD > USD (no price or no date)
Fetching URL https://fx-rate.net/USD/CAD...
Identifier found: 'USD/CAD'
Date found: 'Thu Jul 20 2023'
Unable to update price for USD > CAD (no price or no date)

EXPECTED RESULT

The correct price quote.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Jack 2023-07-20 21:33:32 UTC
please look at bug 472423 and see if that solution fixes if for you also.
Comment 2 Pete 2023-07-20 21:44:36 UTC
(In reply to Jack from comment #1)
> please look at bug 472423 and see if that solution fixes if for you also.

Jack, please clarify your comment.  What should I look at?  Thanks.
Comment 3 Jack 2023-07-20 22:07:16 UTC
Sorry.  https://bugs.kde.org/show_bug.cgi?id=472443 is a newly filed bug for the same issue (I think) which suggests

I have solved it changing 

1\s[^=]+\s=</span><br\s/>\s([^\s]+)

with

1\s[^=]+\s=</span><br/>\s([^\s]+)

If that works for you, I'll close that bug as a duplicate of this one, and close this one as fixed.
 
To make that change, invoke the menu Settings/Configure KMyMoney..., select Online Quotes on the left, then KMyMoney Currency on the right.   The edit is just removing two characters from the regular expression in the Price text box.
Comment 4 Pete 2023-07-20 22:59:02 UTC
Jack,

The change worked fine.

Please close this bug.

Thanks.
Comment 5 Jack 2023-07-20 23:29:04 UTC
*** Bug 472443 has been marked as a duplicate of this bug. ***
Comment 6 Pete 2023-07-25 23:10:53 UTC
The price update for CAD/USD and USD/CAD failed again.

Reverting back to the previous price expression solves the problem.

1\s[^=]+\s=</span><br\s/>\s([^\s]+)
Comment 7 Pete 2023-08-14 18:54:17 UTC
The currency updates are now failing for both suggested price expressions:
1\s[^=]+\s=</span><br\s/>\s([^\s]+)
1\s[^=]+\s=</span><br/>\s([^\s]+)

Do you have a fix?
Comment 8 Jack 2023-08-14 19:34:01 UTC
Try this for the price regexp:

Today\s+=\s+([^<]+)</span>
Comment 9 Pete 2023-08-14 19:40:11 UTC
Still fails but gets further ahead:

Fetching URL https://fx-rate.net/CAD/USD...
Identifier found: 'CAD/USD'
Price found: '0.74256' (0.74256)
Unable to update price for CAD > USD (no price or no date)
Fetching URL https://fx-rate.net/USD/CAD...
Identifier found: 'USD/CAD'
Price found: '1.3468' (1.3468)
Unable to update price for USD > CAD (no price or no date)
Comment 10 Thomas Baumgart 2023-08-15 07:37:31 UTC
Please take a look at https://discuss.kde.org/t/kmoney-currency-udpates-not-working/3037/8 which shows values currently working for me.