cmallwitz / Financials-Extension

Extension for LibreOffice Calc to access stock market data
Other
137 stars 17 forks source link

yahoo source stop working #50

Closed cristobal-ortega closed 2 years ago

cristobal-ortega commented 2 years ago

When getting data with the yahoo provider I get a #N/A value.

For instance: =GETREALTIME(AAPL,"last_price","yahoo") --> #N/A

All values I requested so far get the same result.

cmallwitz commented 2 years ago

Using the projects examples.ods Yahoo seems to be working for me.

cristobal-ortega commented 2 years ago

Not to me. Other sources are working for me such as FT.

cmallwitz commented 2 years ago

In your user home directory there should be a directory called .financials-extension - do the files extension.log and/or trace.log contain any error message?

cristobal-ortega commented 2 years ago

Apologies for the late reply

I erased both files (they contained old data), and reload all my own datasheet (ctrl + F9). As a result:

cmallwitz commented 2 years ago

I'm not sure what is going on here...

AAPL seems to be one of the symbols you are trying to use: are there yahoo-AAPL. files in the same directory location? the *.js version - does it contain data?

Other than that: are you seeing data when opening AAPL in your browser?

cristobal-ortega commented 2 years ago

Yes, I'm trying to fetch data from APPL. There are more files in the directory:

<!DOCTYPE html>

Yahoo forma parte de la familia de marcas de Yahoo ` - yahoo-AAPL.js : it starts with: `// 'https://finance.yahoo.com/quote/AAPL?p=AAPL' QuoteSummaryStore: [['defaultKeyStatistics', [['annualHoldingsTurnover', []], ['enterpriseToRevenue', [['raw', 8.166], ['fmt', '8.17']]], ['beta3Year', []], ['profitMargins', [['raw', 0.25882], ['fmt', '25.88%']]], ['enterpriseToEbitda', [['raw', 24.845], ['fmt', '24.84']]], ['52WeekChange', [['raw', 0.37215054], ['fmt', '37.22%']]], ['morningStarRiskRating', []], ['forwardEps', [['raw', 6.18], ['fmt', '6.18']]], ['revenueQuarterlyGrowth', []],` There is no last_price key I tried deleting them, only .html is re-generated with the same data.
cmallwitz commented 2 years ago

Could you attach the re-generated HTML file here? TBH I don't know why it would not extract the data block from it.

What is your setup/network location - maybe any mandatory proxies? I'm surprised to see Spanish in the HTML file - the extension would always try to connect to the yahoo.com website with English as language.

cristobal-ortega commented 2 years ago

Find attached the html here: https://pastebin.com/4kSC1mr7

My setup has no proxies. From my web browser I get access to yahoo.com as usual. In Calc, I had the configuration taken from the system. I changed to None, I get the same result.

cmallwitz commented 2 years ago

Are you on the latest version of the extension - [3.0.6](https://github.com/cmallwitz/Financials-Extension/releases/tag/3.0.6 ?

The Yahoo cookie consent was updated in that version and that seems to be what is causing your issue. Basically instead of getting data, Yahoo is asking you for cookie consent...

The version of the extension can be checked from Calc menu - Tools - Extension Manager or by adding =GETREALTIME("SUPPORT") to a cell - this will give a few more details about your system setup.

cristobal-ortega commented 2 years ago

I was using an old version.

Thank you, it is working now :)