Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASX Data for financials, cashflow and balance does not appear to be scraped correctly. #250

Closed
mikesinc opened this issue Apr 10, 2020 · 6 comments

Comments

@mikesinc
Copy link

I have made the fixes as described in #191 such that the financials, cashflow and balance sheet scrapings no longer return empty dataframes, however I am further experiencing an issue to do with the actual data scraped from ASX listings.

Some data appears to be correct (e.g. ticker.info, ticker.history) but some appears to not match the Yahoo Finance page. See below example of WPL.AX financials:

image

Compared to the DataFrame output from ticker.financials:

import yfinance as yf
print(yf.Ticker("WPL.AX").financials)

Result:
image

It seems to work when I try the ticker "MSFT" but not for my ASX listings.

Has anyone had this issue or know what is going wrong?

@wnamen
Copy link

wnamen commented Apr 10, 2020

I'm actually just getting empty dataframes, MSFT included:

stock_valuation_1  | ---- DCF ----
stock_valuation_1  | Empty DataFrame
stock_valuation_1  | Columns: [Open, High, Low, Close, Adj Close, Volume]
stock_valuation_1  | Index: []

@AmareswarReddy
Copy link

I have made the fixes as described in #191 such that the financials, cashflow and balance sheet scrapings no longer return empty dataframes, however I am further experiencing an issue to do with the actual data scraped from ASX listings.

Some data appears to be correct (e.g. ticker.info, ticker.history) but some appears to not match the Yahoo Finance page. See below example of WPL.AX financials:

image

Compared to the DataFrame output from ticker.financials:

import yfinance as yf
print(yf.Ticker("WPL.AX").financials)

Result:
image

It seems to work when I try the ticker "MSFT" but not for my ASX listings.

Has anyone had this issue or know what is going wrong?

Hi,
The data that you see on the yahoo finance is wrong for few cases, not sure why.
Even i had same issue with a stock, HDFCBANK.NS, i was working. I have debugged the code as well to check the issue.
Yo can refer to the ASX report here: https://www.asx.com.au/asxpdf/20200213/pdf/44f1ppgf86cfh7.pdf
Following is the screenshot from their annual statement :
image

@rodrigobercini
Copy link

Hello @mikesinc and @AmareswarReddy,

Did you nanage to solve this issue? I'm also getting some incorrect results when scraping financial data. I'm trying to troubleshoot, but no luck so far.

Meanwhile, if you want an alternative way of scraping this data, check this article by @mattbutton

Cheers!

@rodrigobercini
Copy link

rodrigobercini commented Jun 3, 2020

I tried to incorporate matt's code on my fork (dev branch) and it seems to be partly working. Some data is getting correctly scraped, but not all of it.

Feel free to check it out and improve my code.

!pip install git+https://github.com/rodrigobercini/yfinance.git@dev
import yfinance as yf
wpl = yf.Ticker('WPL.AX')
wpl.financials

Cheers!

@dpguthrie
Copy link

If you want a solution that doesn't involve scraping, you can utilize this endpoint: https://query2.finance.yahoo.com/ws/fundamentals-timeseries/v1/finance/timeseries/{symbol} (replacing symbol with your desired symbol). The endpoint requires a few query parameters though: period1, period2, and type. Check here to see what you can pass to each of those: https://github.com/dpguthrie/yahooquery/blob/master/yahooquery/base.py#L252

@rodrigobercini
Copy link

If you want a solution that doesn't involve scraping, you can utilize this endpoint: https://query2.finance.yahoo.com/ws/fundamentals-timeseries/v1/finance/timeseries/{symbol} (replacing symbol with your desired symbol). The endpoint requires a few query parameters though: period1, period2, and type. Check here to see what you can pass to each of those: https://github.com/dpguthrie/yahooquery/blob/master/yahooquery/base.py#L252

Thank you, Doug. Your API is the best choice for retrieving financial data from Yahoo, since it can fetch the correct data for almost all the financial statements. I'm validating the data and everything seems to be consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants