'By ecsys (https://github.com/ecsys)
å¢å äºè·åæçšæ·ææèµè¿ç­æ¡çåèœ #29
(https://github.com/egrcc/zhihu-python/pull/29)'

def get_asks(self):

    if (self.user_url == None):
        print "I'm    anonymous    user."
        return
        (yield)
    else:
        asks_num = self.get_asks_num()
        if (asks_num == 0):
            return
            (yield)
        else:
            for i in xrange((((asks_num - 1) / 20) + 1)):
                ask_url = ((self.user_url + '/asks?page=') + str((i + 1)))
                headers = {'User-Agent': 'Mozilla/5.0    (X11;    Linux    x86_64)    AppleWebKit/537.36    (KHTML,    like    Gecko)    Chrome/42.0.2311.135    Safari/537.36', 'Host': 'www.zhihu.com', 'Origin': 'http://www.zhihu.com', 'Pragma': 'no-cache', 'Referer': 'http://www.zhihu.com/'}
                r = requests.get(ask_url, headers=headers, verify=False)
                soup = BeautifulSoup(r.content, 'lxml')
                for question in soup.find_all('a', class_='question_link'):
                    url = ('http://www.zhihu.com' + question['href'])
                    title = question.string.encode('utf-8')
                    (yield Question(url, title))
