Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions socli/socli.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,15 @@ def wrongsyn(query):

# Get Question stats
def get_stats(soup):
question_tittle = (soup.find_all("a",class_="question-hyperlink")[0].get_text())
question_title = (soup.find_all("a",class_="question-hyperlink")[0].get_text())
question_stats = (soup.find_all("span",class_="vote-count-post")[0].get_text())
question_stats = "Votes " + question_stats + " | " + (((soup.find_all("div",\
class_="module question-stats")[0].get_text()).replace("\n", " ")).replace(" "," | "))
question_desc = (soup.find_all("div", class_="post-text")[0])
add_urls(question_desc)
question_desc = question_desc.get_text()
question_stats = ' '.join(question_stats.split())
return question_tittle, question_desc, question_stats
return question_title, question_desc, question_stats


def add_urls(tags):
Expand All @@ -322,8 +322,9 @@ def hastags():
def dispres(url):
res_page = requests.get(url + query, verify=False)
soup = BeautifulSoup(res_page.text, 'html.parser')
question_tittle, question_desc, question_stats = get_stats(soup)
print_warning("\nQuestion: " + dispstr(question_tittle))
question_title, question_desc, question_stats = get_stats(soup)
print_warning("\nQuestion: " + dispstr(question_title))
print_blue("(" + underline(url) + ")")
print(dispstr(question_desc))
print("\t" + underline(question_stats))
try:
Expand Down