Skip to content

Commit

Permalink
Fix #71
Browse files Browse the repository at this point in the history
  • Loading branch information
guoguo12 committed Sep 16, 2020
1 parent 73a8c94 commit 8a828c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion billboard.py
Expand Up @@ -279,7 +279,10 @@ def _parseNewStylePage(self, soup):
for entrySoup in soup.select("li.chart-list__element"):

def getEntryAttr(selector):
return entrySoup.select_one(selector).text.strip()
element = entrySoup.select_one(selector)
if element:
return element.text.strip()
return None

try:
title = getEntryAttr("span.chart-element__information__song")
Expand Down

0 comments on commit 8a828c7

Please sign in to comment.