cmallwitz / Financials-Extension

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

Unable to parse data from Yahoo statistics page #76

Closed SaltyCybernaut closed 1 year ago

SaltyCybernaut commented 1 year ago

Version 3.2.1 is unable to parse data from the Yahoo statistics page. Based on the error messages, I believe the underlying problem is that Yahoo changed the "div path" to the tables which are parsed for data. Below is the code which was run and the error log.

Python Code and Output

>>> import financials_yahoo as f
>>> y = f.createInstance(None)
>>> y.getRealtime('AAPL', 75)

BaseException ticker=AAPL datacode=75                                                                                                                                                          
Traceback (most recent call last):                                                                                                                                                             
  File "/home/user/Financials-Extension/build/financials_yahoo.py", line 347, in getRealtimeStatistics
    found = statistics.find('./div[2]/div[1]//table').findall('.//tr')                        
AttributeError: 'NoneType' object has no attribute 'findall'

Output of trace.log

2023-01-12 20:18:03.414725 getRealtime *args=('AAPL', 'SHARES_OUT', 'yahoo') r='Yahoo.getRealtimeStatistics(AAPL, 75) - process: 'NoneType' object has no attribute 'findall'' 991.288 ms

cmallwitz commented 1 year ago

Could you upload/attach the file (starting from your home directory) .financials-extension/yahoo-AAPL.html here?

cmallwitz commented 1 year ago

or rather yahoo-APPL-statistics.html

SaltyCybernaut commented 1 year ago

HTML was not a supported file type, so I had to ZIP it.

yahoo-AAPL-statistics.html.zip

Durhammer3111 commented 1 year ago

Take a look at my entry (#77) -- it's not just the statistics files, it looks like any file -- at least my quotes files!

SaltyCybernaut commented 1 year ago

@cmallwitz, after the update to v3.3.0. I am still seeing failures for "SHARES_OUT", "last_price_date", and "last_price_time" from Yahoo.

cmallwitz commented 1 year ago

"last_price_date" and "last_price_time" is not available in an extract-able form. SHARES_OUT should be available - do you have a example symbol?

SaltyCybernaut commented 1 year ago

Since 'LAST_PRICE_DATE' and 'LAST_PRICE_TIME' are no longer supported by Yahoo per the documentation, this Issue can be closed.

@cmallwitz thank you for the effort you put into this project, it benefits many people including myself.