Skip to content

Commit

Permalink
Merge pull request #47 from arount/no-answers-text
Browse files Browse the repository at this point in the history
Add text 'No answers for this question ...' to avoid simple exit
  • Loading branch information
gautamkrishnar authored Apr 21, 2017
2 parents 61b107e + f43ecd7 commit 235a19d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions socli/socli.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ def get_question_stats_and_answer(url):
soup = BeautifulSoup(res_page.text, 'html.parser')
question_title, question_desc, question_stats = get_stats(soup)
answers = [s.get_text() for s in soup.find_all("div", class_="post-text")][1:] # first post is question, discard it.
if len(answers) == 0:
answers.append('No answers for this question ...')
return question_title, question_desc, question_stats, answers


Expand Down

0 comments on commit 235a19d

Please # to comment.