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

Unable to get stock profile data #160

Closed
nathphoenix opened this issue Nov 9, 2023 · 4 comments
Closed

Unable to get stock profile data #160

nathphoenix opened this issue Nov 9, 2023 · 4 comments

Comments

@nathphoenix
Copy link

nathphoenix commented Nov 9, 2023

Please this function is failing get_stock_profile_data and others when i run them.

This is the error below

HTTPSConnectionPool(host='query2.finance.yahoo.com', port=443): Max retries exceeded with url: /v6/finance/quoteSummary/googl?modules=assetProfile&formatted=False&lang=en-US&region=US&corsDomain=finance.yahoo.com (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000002A2BE011000>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')))

Server replied with server error code, HTTP 404 code while opening the url: https://query1.finance.yahoo.com/v6/finance/quoteSummary/googl?modules=assetProfile&formatted=False&lang=en-US&region=US&corsDomain=finance.yahoo.com

@flipdazed @sylvandb @VKorelsky

Please what could be the possible reason

@pzarfos
Copy link

pzarfos commented Nov 12, 2023

Are you running an ad-blocker?

I am running pi-hole and had a similar issue, which I fixed by adding the yahoo finance domain names to my ad-blocker whitelist.

more info here - #159 (comment)

@GerdSidan
Copy link

For me getting stock profile data also does not work any longer. This simple program:

from yahoofinancials import YahooFinancials
fins = YahooFinancials('AAPL', concurrent=False, max_workers=8, country="US")
companydata = fins.get_stock_profile_data()

results in this traceback:

Traceback (most recent call last):
  File "<Path my test file>\yahoofinancials-GetProfile-SimpleTest.py", line 4, in <module>
    companydata = fins.get_stock_profile_data()
  File "<Path to my Python installation>\Python310\lib\site-packages\yahoofinancials\yf.py", line 114, in get_stock_profile_data
    self.get_stock_data(statement_type='profile', tech_type='assetProfile', report_name='assetProfile'),
  File "<Path to my Python installation>\Python310\lib\site-packages\yahoofinancials\etl.py", line 565, in get_stock_data
    dict_ent = self._create_dict_ent(self.ticker, statement_type, tech_type, report_name, hist_obj)
  File "<Path to my Python installation>\Python310\lib\site-packages\yahoofinancials\etl.py", line 521, in _create_dict_ent
    re_data = self._get_historical_data(YAHOO_URL, r_map, tech_type, statement_type)
  File "<Path to my Python installation>\Python310\lib\site-packages\yahoofinancials\etl.py", line 248, in _get_historical_data
    self._request_handler(url, config.get("response_field"))
  File "<Path to my Python installation>\Python310\lib\site-packages\yahoofinancials\etl.py", line 190, in _request_handler
    cur_url += "&crumb=" + self.crumb
TypeError: can only concatenate str (not "NoneType") to str

Tested on Windows 10 with Python 3.10.1 and yahoofinancials 1.17. The error also occurs on Debian 12 with Python 3.11.2 and yahoofinancials 1.17.

@JECSand
Copy link
Owner

JECSand commented Dec 10, 2023

@GerdSidan Could you try that on v1.18?

@JECSand
Copy link
Owner

JECSand commented Dec 13, 2023

Just released v1.19 which includes a fix for this issue.

@JECSand JECSand closed this as completed Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants