Skip to content

Commit

Permalink
Merge pull request #1124 from Jossan84/main
Browse files Browse the repository at this point in the history
Bugfix: Get logo url when no website exists
  • Loading branch information
ValueRaider committed Oct 27, 2022
2 parents e99e61f + 42e5751 commit 22131e9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions yfinance/base.py
Expand Up @@ -467,9 +467,12 @@ def _get_info(self, proxy=None):

self._info['logo_url'] = ""
try:
domain = self._info['website'].split(
'://')[1].split('/')[0].replace('www.', '')
self._info['logo_url'] = 'https://logo.clearbit.com/%s' % domain
if not 'website' in self._info:
self._info['logo_url'] = 'https://logo.clearbit.com/%s.com' % self._info['shortName'].split(' ')[0].split(',')[0]
else:
domain = self._info['website'].split(
'://')[1].split('/')[0].replace('www.', '')
self._info['logo_url'] = 'https://logo.clearbit.com/%s' % domain
except Exception:
pass

Expand Down

0 comments on commit 22131e9

Please sign in to comment.