Skip to content

Commit

Permalink
Merge pull request #1 from thegraycoder/bugfix-vote-count
Browse files Browse the repository at this point in the history
shobrook#46: Fixing index error on vote count
  • Loading branch information
thegraycoder committed Apr 30, 2019
2 parents f8f0b98 + fa484f9 commit 8580f4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rebound/rebound.py
Expand Up @@ -304,9 +304,9 @@ def get_question_and_answers(url):
return "Sorry, Stack Overflow blocked our request. Try again in a couple seconds.", "", "", ""
else:
question_title = soup.find_all('a', class_="question-hyperlink")[0].get_text()
question_stats = soup.find("div", class_="js-vote-count").get_text() # Vote count

try:
question_stats = soup.find("div", class_="js-vote-count").get_text() # Vote count
question_stats = question_stats + " Votes | " + '|'.join((((soup.find_all("div", class_="module question-stats")[0].get_text())
.replace('\n', ' ')).replace(" ", " | ")).split('|')[:2]) # Vote count, submission date, view count
except IndexError:
Expand Down

0 comments on commit 8580f4b

Please sign in to comment.