From 59b613e5b04462b38cd9d329506d3317ab9fbd7a Mon Sep 17 00:00:00 2001 From: hzcortex Date: Thu, 2 Jun 2016 16:20:43 +0800 Subject: [PATCH 1/3] Update zhihu.py --- zhihu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zhihu.py b/zhihu.py index e00e939..2c9ceb7 100755 --- a/zhihu.py +++ b/zhihu.py @@ -700,9 +700,9 @@ def get_asks_num(self): if self.soup == None: self.parser() soup = self.soup - asks_num = int(soup.find_all("span", class_="num")[0].string) + ask_num=int(soup.find_all('a',href="/people/"+self.user_id+"/asks").find("span").string) return asks_num - + def get_answers_num(self): if self.user_url == None: print "I'm anonymous user." From 1b82883e4ce53960d71222e0775cac82bfd3eb78 Mon Sep 17 00:00:00 2001 From: hzcortex Date: Thu, 2 Jun 2016 16:21:56 +0800 Subject: [PATCH 2/3] Update zhihu.py --- zhihu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zhihu.py b/zhihu.py index 2c9ceb7..9a1f1e1 100755 --- a/zhihu.py +++ b/zhihu.py @@ -700,7 +700,7 @@ def get_asks_num(self): if self.soup == None: self.parser() soup = self.soup - ask_num=int(soup.find_all('a',href="/people/"+self.user_id+"/asks").find("span").string) + ask_num = int(soup.find_all('a',href="/people/"+self.user_id+"/asks").find("span").string) return asks_num def get_answers_num(self): From 547d860bd2ebd268cbb6d8eb1d2fdf723c95b2e3 Mon Sep 17 00:00:00 2001 From: hzcortex Date: Thu, 2 Jun 2016 16:22:52 +0800 Subject: [PATCH 3/3] Update zhihu.py --- zhihu.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zhihu.py b/zhihu.py index 9a1f1e1..b7a0f14 100755 --- a/zhihu.py +++ b/zhihu.py @@ -700,7 +700,8 @@ def get_asks_num(self): if self.soup == None: self.parser() soup = self.soup - ask_num = int(soup.find_all('a',href="/people/"+self.user_id+"/asks").find("span").string) + ask_num = int(soup.find_all('a', href="/people/" + + self.user_id + "/asks").find("span").string) return asks_num def get_answers_num(self):