Good point on that yFinance works from a local desktop.
I noticed about a month ago, if I had turned on my local VPN service (ExpressVPN), I was getting the following error when checking for the short name: sShortName = df.info['shortName']
Traceback (most recent call last):
File "c:....\Yahoo.py", ....
sShortName = df.info['shortName']
File "c:....\Python\Python39\lib\site-packages\yfinance\ticker.py", line 159, in info
return self.get_info()
File "c:....\Python\Python39\lib\site-packages\yfinance\base.py", line 229, in get_info
data = self.quote.info
File "c:....\Python\Python39\lib\site-packages\yfinance\scrapers\quote.py", line 508, in info
self._fetch_info(self.proxy)
File "c:....\Python\Python39\lib\site-packages\yfinance\scrapers\quote.py", line 598, in _fetch_info
result = self._fetch(proxy, modules=modules)
File "c:....\Python\Python39\lib\site-packages\yfinance\scrapers\quote.py", line 587, in _fetch
result = self._data.get_raw_json(_QUOTE_SUMMARY_URL + f"/{self._symbol}", user_agent_headers=self._data.user_agent_headers, params=params_dict, proxy=proxy)
File "c:....\Python\Python39\lib\site-packages\yfinance\data.py", line 398, in get_raw_json
response = self.get(url, user_agent_headers=user_agent_headers, params=params, proxy=proxy, timeout=timeout)
File "c:....\Python\Python39\lib\site-packages\yfinance\utils.py", line 104, in wrapper
result = func(args, kwargs)
File "c:....\Python\Python39\lib\site-packages\yfinance\data.py", line 366, in get
response = self._session.get(request_args)
File "c:....\Python\Python39\lib\site-packages\requests\sessions.py", line 602, in get
return self.request("GET", url, kwargs)
File "c:....\Python\Python39\lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, send_kwargs)
File "c:....\Python\Python39\lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, *kwargs)
File "c:....\Python\Python39\lib\site-packages\requests\adapters.py", line 501, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))
pip show yfinance (current version of yfinance)
Name: yfinance
Version: 0.2.44
This looks like a firewall issue at PA's whether it be something Yahoo or PA. What is confusing is that it sometimes works if my VPN and sometimes not. (Hence PA's response that it works for them.)
Bottomline is, turning off/on VPN from my local desktop causes it to fail thus pointing to a firewall issue.
To support that though is using Google Chrome and after a search clicking on an search item, if VPN is turned on, Google Click services fail. (Their ad services.) Turning off VPN it works. ExpressVPN says Google is block (or failing) because too many requests are coming from a single IP address. Wonder if this could be the same issue with Yahoo?
Hope this helps.