From 3f00e950af54fd33fff2ee0a5f2f7734fdaa2dc4 Mon Sep 17 00:00:00 2001 From: praroh2 Date: Mon, 22 Dec 2014 23:38:32 +0530 Subject: [PATCH] Improved get_user_stats --- quora/pyquora.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quora/pyquora.py b/quora/pyquora.py index 479c825..4ef86c4 100644 --- a/quora/pyquora.py +++ b/quora/pyquora.py @@ -101,7 +101,9 @@ def get_user_stats(user): err = None for item in soup.findAll('span', attrs={'class' : 'profile_count'}): - data_stats.append(item.string) + m = re.findall('\d', str(item)) + element = ''.join(m) + data_stats.append(element) data_stats = map(try_cast, data_stats) user_dict = {'answers' : data_stats[1],