Skip to content

Commit

Permalink
Add text 'No answers for this question ...' to avoid simple exist
Browse files Browse the repository at this point in the history
  • Loading branch information
arount committed Apr 20, 2017
1 parent 61b107e commit f43ecd7
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 f43ecd7

Please # to comment.