Skip to content

Commit

Permalink
Merge pull request #1064 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 ecdc36a + 42e5751 commit e3d2c5d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions yfinance/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,9 +674,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 e3d2c5d

Please sign in to comment.