In [4]:
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
topic_url = 'https://www.zhihu.com/topic/19776153/hot'

In [5]:
headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'}
payload = {'start':0, 'offset':2800}
r = requests.post(topic_url,headers=headers,data=payload) #r.text
print r.json()['msg'][1]
soup = BeautifulSoup(r.json()['msg'][1],'lxml') #soup
questions_soup = soup.find_all('a',attrs={'class':'question_link'}) #questions_soup
## -1-2 num == num len == 1
len(questions_soup)
for q_soup in questions_soup: print q_soup.text

topic-top-answers

topic_top_answers_url_pattern = 'https://www.zhihu.com/topic/%s/top-answers'
#payload = {'start':0, 'offset':2800}
r = requests.get(topic_top_answers_url_pattern%'19776153',headers=headers)#,data=payload) r.text
# content soup = BeautifulSoup(r.text) content_soup = soup.find_all('div',attrs={'class':'content'}) len(content_soup)
for content in content_soup:
class Topic(object): def __init__(self,topic) class Question(object): class Answer(object): class User(object): def __init__(self,da): def name(self):

In [3]:
zhihu_url = 'https://www.zhihu.com'

In [4]:
class Answer(object):
    def __init__(self,href):
        self.url = zhihu_url+href
        self.res = requests.get(self.url,headers=headers)
        if self.res.status_code == 200:
            self.soup = BeautifulSoup(self.res.text,'lxml')
        qs = self.soup.find_all('div',attrs={'class':'QuestionAnswer-content'})[0]
        ca = qs.find_all('div',attrs={'class':'ContentItem AnswerItem'})[0]
        ac = ca.find_all('div',attrs={'class':'AuthorInfo-content'})[0]
        try:
            ul = ac.find_all('a',attrs={'class':'UserLink-link'})[0]
            self.userlink = ul['href']
        except:
            self.userlink = ''
        ri = ca.find_all('div',attrs={'class':'RichContent-inner'})[0]
        self.text = ri.text
answer_url = 'https://www.zhihu.com/question/47145647/answer/128043449'
r = requests.get(answer_url,headers=headers) r.text soup = BeautifulSoup(r.text) qs = soup.find_all('div',attrs={'class':'QuestionAnswer-content'})[0]
r.text
ca = qs.find_all('div',attrs={'class':'ContentItem AnswerItem'})[0] #ca.attrs
ac = ca.find_all('div',attrs={'class':'AuthorInfo-content'})[0] print ac ul = ac.find_all('a',attrs={'class':'UserLink-link'})[0]
ul['href']
ri = ca.find_all('div',attrs={'class':'RichContent-inner'})[0]
print ri.get_text()

In [5]:
a = Answer('/question/21789715/answer/19345625')
webdriver.Chrome?
phantomjs = webdriver.PhantomJS(r'e:\Anaconda2\Lib\site-packages\selenium\webdriver_path\phantomjs-2.1.1-windows\bin\phantomjs.exe')
#phantomjs = webdriver.Chrome('E:\Anaconda2\Lib\site-packages\selenium\webdriver_path\chromedriver.exe')
#phantomjs.implicitly_wait(3)
phantomjs.get(answer_url)
qc = phantomjs.find_element_by_class_name('QuestionAnswer-content')
qs = self.soup.find_all('div',attrs={'class':'QuestionAnswer-content'})[0] ca = qs.find_all('div',attrs={'class':'ContentItem AnswerItem'})[0] ac = ca.find_all('div',attrs={'class':'AuthorInfo-content'})[0] print ac ul = ac.find_all('a',attrs={'class':'UserLink-link'})[0] || UserLink self.userlink = ul['href'] ri = ca.find_all('div',attrs={'class':'RichContent-inner'})[0] self.text = ri.text
cm = qc.find_element_by_class_name('ContentItem-meta') ac = cm.find_element_by_class_name('AuthorInfo-content') ul = ac.find_element_by_class_name('UserLink-link')
print ac.text

In [6]:
print a.text


这是一个国家的悲哀……优质教育资源极度短缺而且分布极度失衡之下,不得已而出现的一种现象-----分数决定命运……衡中的老师无罪,衡中的校长无罪,河北的孩子受罪,河北的家长流泪……如果能把三公消费降下来,贴在教育上,让河北也有几个能与北京抗衡的大学,河北的孩子会让北上的孩子明白,我们河北人也能有艺术造诣,也有创造性思维,河北的老师也会让北上广的老师明白,我们河北的老师也可以搞素质教育,也会组织活动,组织讨论,但是在可以预见的未来,这终究是一个梦

In [26]:
zhihu_api_url = 'https://www.zhihu.com/api/v4/topics/{}'

In [27]:
headers2 = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
          #'accept':'application/json, text/plain, */*',
          'authorization':'oauth c3cef7c66a1843f8b3a9e6a1e3160e20',
          #'x-udid':'AECCYdU9KwuPTh4DahhnpQ6AhG5JM4h5rdY='
          }

In [34]:
r = requests.get(zhihu_api_topics.format('19552439'),headers=headers2)

In [35]:
r.content


Out[35]:
'{"name": "NBA", "url": "http://www.zhihu.com/api/v4/topics/19552439", "excerpt": "NBA\\uff08\\u5168\\u79f0 National Basketball Association\\uff0c\\u4e2d\\u6587\\u6b63\\u5f0f\\u8bd1\\u540d\\u4e3a\\u56fd\\u5bb6\\u7bee\\u7403\\u534f\\u4f1a\\uff09\\u662f\\u7f8e\\u56fd\\u7b2c\\u4e00\\u5927\\u804c\\u4e1a\\u7bee\\u7403\\u7ec4\\u7ec7\\uff0c\\u534f\\u4f1a\\u4e00\\u5171\\u62e5\\u6709 30 \\u652f\\u7403\\u961f\\uff0c\\u5206\\u5c5e\\u4e24\\u4e2a\\u8054\\u76df\\uff08Conference\\uff09\\uff1a\\u4e1c\\u90e8\\u8054\\u76df\\u548c\\u897f\\u90e8\\u8054\\u76df\\u3002", "introduction": "NBA\\uff08\\u5168\\u79f0 National Basketball Association\\uff0c\\u4e2d\\u6587\\u6b63\\u5f0f\\u8bd1\\u540d\\u4e3a\\u56fd\\u5bb6\\u7bee\\u7403\\u534f\\u4f1a\\uff09\\u662f\\u7f8e\\u56fd\\u7b2c\\u4e00\\u5927\\u804c\\u4e1a\\u7bee\\u7403\\u7ec4\\u7ec7\\uff0c\\u534f\\u4f1a\\u4e00\\u5171\\u62e5\\u6709 30 \\u652f\\u7403\\u961f\\uff0c\\u5206\\u5c5e\\u4e24\\u4e2a\\u8054\\u76df\\uff08Conference\\uff09\\uff1a\\u4e1c\\u90e8\\u8054\\u76df\\u548c\\u897f\\u90e8\\u8054\\u76df\\u3002", "followers_count": 235012, "avatar_url": "https://pic1.zhimg.com/5daddd688_is.jpg", "is_following": false, "best_answers_count": 1000, "type": "topic", "id": "19552439", "questions_count": 31691}'

In [36]:
j = r.json()

In [37]:
j


Out[37]:
{u'avatar_url': u'https://pic1.zhimg.com/5daddd688_is.jpg',
 u'best_answers_count': 1000,
 u'excerpt': u'NBA\uff08\u5168\u79f0 National Basketball Association\uff0c\u4e2d\u6587\u6b63\u5f0f\u8bd1\u540d\u4e3a\u56fd\u5bb6\u7bee\u7403\u534f\u4f1a\uff09\u662f\u7f8e\u56fd\u7b2c\u4e00\u5927\u804c\u4e1a\u7bee\u7403\u7ec4\u7ec7\uff0c\u534f\u4f1a\u4e00\u5171\u62e5\u6709 30 \u652f\u7403\u961f\uff0c\u5206\u5c5e\u4e24\u4e2a\u8054\u76df\uff08Conference\uff09\uff1a\u4e1c\u90e8\u8054\u76df\u548c\u897f\u90e8\u8054\u76df\u3002',
 u'followers_count': 235012,
 u'id': u'19552439',
 u'introduction': u'NBA\uff08\u5168\u79f0 National Basketball Association\uff0c\u4e2d\u6587\u6b63\u5f0f\u8bd1\u540d\u4e3a\u56fd\u5bb6\u7bee\u7403\u534f\u4f1a\uff09\u662f\u7f8e\u56fd\u7b2c\u4e00\u5927\u804c\u4e1a\u7bee\u7403\u7ec4\u7ec7\uff0c\u534f\u4f1a\u4e00\u5171\u62e5\u6709 30 \u652f\u7403\u961f\uff0c\u5206\u5c5e\u4e24\u4e2a\u8054\u76df\uff08Conference\uff09\uff1a\u4e1c\u90e8\u8054\u76df\u548c\u897f\u90e8\u8054\u76df\u3002',
 u'is_following': False,
 u'name': u'NBA',
 u'questions_count': 31691,
 u'type': u'topic',
 u'url': u'http://www.zhihu.com/api/v4/topics/19552439'}
people_url = 'http://www.zhihu.com/api/v4/people/9c4e2590c97695855341d9e16700d130'

In [33]:
# util.py
import requests

headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)\
        AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
          'authorization':'oauth c3cef7c66a1843f8b3a9e6a1e3160e20',
          }
zhihu_page_question_url = 'https://www.zhihu.com/question/{}'

zhihu_api = 'https://www.zhihu.com/api/v4/'
zhihu_api_topics = 'https://www.zhihu.com/api/v4/topics/{}?include=introduction%2Cquestions_count%2Cbest_answers_count%2Cfollowers_count%2Cis_following'

zhihu_api_questions = zhihu_api+'questions/{}'
zhihu_api_answers = zhihu_api+'answers/{}'
zhihu_api_answers_comments = zhihu_api+'''answers/{}/comments?include=data%5B*%5D.author%2Ccollapsed%2C
reply_to_author%2Cdisliked%2Ccontent%2Cvoting%2Cvote_count%2Cis_parent_author%2C
is_author&order=normal&limit=20&offset=0&status=open'''
questions_answers_include = '''include=data%5B*%5D.is_normal%2Cis_sticky%2Ccollapsed_by%2Csuggest_edit%2Ccomment_count%2C\
can_comment%2Ccontent%2Ceditable_content%2Cvoteup_count%2Creshipment_settings%2Ccomment_permission%2Cmark_infos%2C\
created_time%2Cupdated_time%2Crelationship.is_authorized%2Cis_author%2Cvoting%2Cis_thanked%2Cis_nothelp%2Cupvoted_followees%3B\
data%5B*%5D.author.badge%5B%3F(type%3Dbest_answerer)%5D.topics'''
zhihu_api_questions_answers = zhihu_api+'questions/{}/answers?limit=20&offset=0'+'&'+questions_answers_include
zhihu_api_new_question_up = zhihu_api+'banners/new_question_up?question_token={}'
zhihu_api_new_question_down = zhihu_api+'banners/new_question_down?question_token={}'
zhihu_api_similar_questions = zhihu_api+'questions/{}/similar-questions?include=data%5B%2A%5D.answer_count%2Cauthor&limit=5&offset=0'

zhihu_api_people = zhihu_api+'people/{}'
members_include = '''include=locations%2Cemployments%2Cgender%2Ceducations%2Cbusiness%2Cvoteup_count%2Cthanked_Count%2C\
follower_count%2Cfollowing_count%2Ccover_url%2Cfollowing_topic_count%2Cfollowing_question_count%2Cfollowing_favlists_count%2C\
following_columns_count%2Cavatar_hue%2Canswer_count%2Carticles_count%2Cpins_count%2Cquestion_count%2C\
commercial_question_count%2Cfavorite_count%2Cfavorited_count%2Clogs_count%2Cmarked_answers_count%2Cmarked_answers_text%2C\
message_thread_token%2Caccount_status%2Cis_active%2Cis_force_renamed%2Cis_bind_sina%2Csina_weibo_url%2C\
sina_weibo_name%2Cshow_sina_weibo%2Cis_blocking%2Cis_blocked%2Cis_following%2Cis_followed%2Cmutual_followees_count%2Cvote_to_count%2C\
vote_from_count%2Cthank_to_count%2Cthank_from_count%2Cthanked_count%2Cdescription%2Chosted_live_count%2C\
participated_live_count%2Callow_message%2Cindustry_category%2Corg_name%2Corg_homepage%2C\
badge%5B%3F(type%3Dbest_answerer)%5D.topics'''
zhihu_api_members = zhihu_api+'members/{}'+'?'+members_include

zhihu_api_members_followees = zhihu_api+'members/{}/followees?offset=0&limit=20'+'&'+members_include
zhihu_api_members_followers = zhihu_api+'members/{}/followers?offset=0&limit=20'+'&'+members_include
zhihu_api_members_activities = zhihu_api+'members/{}/activities?offset=0&limit=20' #&after_id=1418481629&desktop=True
members_answers_include = '''include=data%5B*%5D.is_normal%2Csuggest_edit%2Ccomment_count%2C\
can_comment%2Ccontent%2Cvoteup_count%2Creshipment_settings%2Ccomment_permission%2C\
mark_infos%2Ccreated_time%2Cupdated_time%2Crelationship.is_authorized%2Cvoting%2C\
is_author%2Cis_thanked%2Cis_nothelp%2Cupvoted_followees%3Bdata%5B*%5D.author.badge%5B%3F\
(type%3Dbest_answerer)%5D.topics'''
zhihu_api_members_answers =  zhihu_api+'members/{}/answer?offset=0&limit=20&sort_by=created'+'&'+members_answers_include
  
zhihu_api_members_questions = zhihu_api+'members/{}/questions?include=data%5B*%5D.created%2Canswer_count%2Cfollower_count%2Cauthor&offset=0&limit=20'
zhihu_api_members_pins = zhihu_api+'members/{}/pins?offset=0&limit=20&includes=data%5B*%5D.upvoted_followees'
zhihu_api_members_articles = zhihu_api+'members/{}/articles?include=data%5B*%5D.comment_count%2Ccan_comment%2Ccomment_permission%2Ccontent%2Cvoteup_count%2Ccreated%2Cupdated%2Cupvoted_followees%2Cvoting%3Bdata%5B*%5D.author.badge%5B%3F(type%3Dbest_answerer)%5D.topics&offset=0&limit=20&sort_by=created'
zhihu_api_members_column_contributions = zhihu_api+'members/{}/column-contributions?include=data%5B*%5D.column.title%2Cintro%2Cdescription%2Cfollowers%2Carticles_count&offset=0&limit=20'    
zhihu_api_members_favlists = zhihu_api+'members/{}/favlists?include=data%5B*%5D.updated_time%2Canswer_count%2Cfollower_count%2Ccreator%2Cis_public&offset=0&limit=20'
zhihu_api_members_following_columns = zhihu_api+'members/{}/following-columns?include=data%5B*%5D.intro%2Cfollowers%2Carticles_count%2Cimage_url%2Cimage_width%2Cimage_height%2Cis_following%2Clast_article.created&offset=0&limit=20'    
zhihu_api_members_following_topic_contributions = zhihu_api+'members/{}/following-topic-contributions?include=data%5B*%5D.topic.introduction&offset=0&limit=20'
zhihu_api_members_following_questions = zhihu_api+'members/{}/following-questions?include=data%5B*%5D.created%2Canswer_count%2Cfollower_count%2Cauthor&offset=0&limit=20'
zhihu_api_members_following_favlists = zhihu_api+'members/{}/following-favlists?include=data%5B*%5D.updated_time%2Canswer_count%2Cfollower_count%2Ccreator&offset=0&limit=20'
    
    
def get_data_from_zhihu_api(api,token):
    data = {'totals':0,'items':[]}
    res = requests.get(api.format(token),headers=headers)
    j = res.json()
    if not 'offset' in api:
        return j
    else:
        try:
            data['totals'] = j['paging']['totals']
        except:
            data['totals'] = None
        data['items'].extend(j['data'])
        while not j['paging']['is_end']:
            res = requests.get(j['paging']['next'],headers=headers)
            j = res.json()
            data['items'].extend(j['data'])
        return data

def get_questions(question_token):
    questions = get_data_from_zhihu_api(zhihu_api_questions,question_token)
    answers = get_data_from_zhihu_api(zhihu_api_questions_answers,question_token)
    similar_questions = get_data_from_zhihu_api(zhihu_api_similar_questions,question_token)
    return questions,answers,similar_questions
def get_members(members_token):
    members = get_data_from_zhihu_api(zhihu_api_members,members_token)
    followees = get_data_from_zhihu_api(zhihu_api_members_followees,members_token)
    followers = get_data_from_zhihu_api(zhihu_api_members_followers,members_token)
    return members,followees,followers

In [8]:
import os
import codecs
import json
import pickle
program_dir=r'C:\Users\lxp\jupyter_notebooks\kaggle\quora\quora-mining'

class Question(object):
    def __init__(self,question_token):
        self.question_token = question_token
        self.questions,self.answers,self.similar_questions = get_questions(self.question_token)
    def save_to_json(self):
        print program_dir
        question_dir = os.path.join(program_dir,'db\\json\\zhihu\\question')
        if not os.path.exists(question_dir):
            os.mkdir(question_dir)
        self.json_path = os.path.join(question_dir,str(self.question_token)+'.json')
        if not os.path.exists(self.json_path):
            with codecs.open(self.json_path,'wb',encoding='utf-8') as f:
                json.dump({'questions': self.questions,'answers':self.answers,'similar_questions':self.similar_questions},f)
                f.close()
    def save_to_pickle(self):
        question_dir = os.path.join(program_dir,'db\\pickle\\zhihu\\question')
        if not os.path.exists(question_dir):
            os.mkdir(question_dir)
        self.pickle_path = os.path.join(question_dir,str(self.question_token)+'.pickle')
        if not os.path.exists(self.pickle_path):
            with codecs.open(self.pickle_path,'wb',encoding='utf-8') as f:
                pickle.dump(self,f)
                f.close()

In [9]:
q = Question(20277085)

In [10]:
q.save_to_json()


C:\Users\lxp\jupyter_notebooks\kaggle\quora\quora-mining

In [11]:
q.json_path


Out[11]:
'C:\\Users\\lxp\\jupyter_notebooks\\kaggle\\quora\\quora-mining\\db\\json\\zhihu\\question\\20277085.json'

In [12]:
q.save_to_pickle()

In [13]:
q.pickle_path


Out[13]:
'C:\\Users\\lxp\\jupyter_notebooks\\kaggle\\quora\\quora-mining\\db\\pickle\\zhihu\\question\\20277085.pickle'

In [14]:
q.questions


Out[14]:
{u'admin_closed_comment': False,
 u'allow_delete': False,
 u'answer_count': 19,
 u'author': {u'avatar_url': u'https://pic4.zhimg.com/f38543fcb_is.jpg',
  u'avatar_url_template': u'https://pic4.zhimg.com/f38543fcb_{size}.jpg',
  u'badge': [],
  u'gender': 1,
  u'headline': u'\u7231\u6298\u817e\u7684\u7f16\u7a0b\u7231\u597d\u8005',
  u'id': u'fa41e042c407aa164ce06cb27af397a1',
  u'is_advertiser': False,
  u'is_followed': False,
  u'is_following': False,
  u'is_org': False,
  u'name': u'Paul Wu',
  u'type': u'people',
  u'url': u'http://www.zhihu.com/api/v4/people/fa41e042c407aa164ce06cb27af397a1',
  u'url_token': u'paul-wu',
  u'user_type': u'people'},
 u'can_comment': {u'reason': u'', u'status': True},
 u'comment_count': 0,
 u'comment_permission': u'all',
 u'created': 1338818478,
 u'detail': u'',
 u'draft': {},
 u'except': u'',
 u'follower_count': 127,
 u'id': 20277085,
 u'is_editable': False,
 u'is_reportable': True,
 u'question_type': u'normal',
 u'redirection': {u'from': [], u'to': {}},
 u'relationship': {u'is_anonymous': False,
  u'is_author': False,
  u'is_following': False},
 u'status': {u'is_close': False,
  u'is_evaluate': False,
  u'is_locked': False,
  u'is_suggest': False},
 u'suggest_edit': {u'reason': u'', u'status': False},
 u'title': u'\u5317\u4eac\u5f88\u591a\u4e2d\u5b66\u90fd\u5f00\u8bbe\u5206\u6821\uff0c\u8fd9\u4e9b\u5206\u6821\u7684\u6559\u5b66\u8d28\u91cf\u548c\u603b\u90e8\u4e00\u6837\u5417\uff1f\u6bd4\u5982\u4eba\u5927\u9644\u4e2d\u671d\u9633\u5b66\u6821',
 u'topics': [{u'avatar_url': u'https://pic2.zhimg.com/7ed40080d_is.jpg',
   u'excerpt': u'',
   u'id': u'19572269',
   u'introduction': u'',
   u'name': u'\u4e2d\u56fd\u6559\u80b2',
   u'type': u'topic',
   u'url': u'http://www.zhihu.com/api/v4/topics/19572269'},
  {u'avatar_url': u'https://pic4.zhimg.com/daabbff63_is.jpg',
   u'excerpt': u'',
   u'id': u'19586726',
   u'introduction': u'',
   u'name': u'\u4e2d\u5b66\u6559\u80b2',
   u'type': u'topic',
   u'url': u'http://www.zhihu.com/api/v4/topics/19586726'},
  {u'avatar_url': u'https://pic2.zhimg.com/fa17e14a1_is.jpg',
   u'excerpt': u'\u4e2d\u56fd\u4eba\u6c11\u5927\u5b66\u9644\u5c5e\u4e2d\u5b66\uff08\u4eba\u5927\u9644\u4e2d\uff09\u521b\u529e\u4e8e1950\u5e744\u6708\uff0c\u662f\u5168\u65e5\u5236\u521d\u4e2d/\u9ad8\u4e2d\u3002',
   u'id': u'19687407',
   u'introduction': u'\u4e2d\u56fd\u4eba\u6c11\u5927\u5b66\u9644\u5c5e\u4e2d\u5b66\uff08\u4eba\u5927\u9644\u4e2d\uff09\u521b\u529e\u4e8e1950\u5e744\u6708\uff0c\u662f\u5168\u65e5\u5236\u521d\u4e2d/\u9ad8\u4e2d\u3002',
   u'name': u'\u4e2d\u56fd\u4eba\u6c11\u5927\u5b66\u9644\u5c5e\u4e2d\u5b66',
   u'type': u'topic',
   u'url': u'http://www.zhihu.com/api/v4/topics/19687407'},
  {u'avatar_url': u'https://pic1.zhimg.com/e82bab09c_is.jpg',
   u'excerpt': u'',
   u'id': u'19690925',
   u'introduction': u'',
   u'name': u'\u5317\u4eac\u6559\u80b2',
   u'type': u'topic',
   u'url': u'http://www.zhihu.com/api/v4/topics/19690925'},
  {u'avatar_url': u'https://pic1.zhimg.com/e82bab09c_is.jpg',
   u'excerpt': u'',
   u'id': u'19713384',
   u'introduction': u'',
   u'name': u'\u5b66\u533a\u623f',
   u'type': u'topic',
   u'url': u'http://www.zhihu.com/api/v4/topics/19713384'}],
 u'type': u'question',
 u'updated_time': 1338818478,
 u'url': u'http://www.zhihu.com/api/v4/questions/20277085'}

In [16]:
q.answers['items'][0]


Out[16]:
{u'author': {u'avatar_url': u'https://pic3.zhimg.com/09aff39fe_is.jpg',
  u'avatar_url_template': u'https://pic3.zhimg.com/09aff39fe_{size}.jpg',
  u'badge': [],
  u'gender': 1,
  u'headline': u' \u51c6\u533b\u751f\uff0c\u4f2a\u7801\u519c',
  u'id': u'777af5ef2077a8474fb9372b3eee0df7',
  u'is_advertiser': False,
  u'is_followed': False,
  u'is_following': False,
  u'is_org': False,
  u'name': u'\u5f20\u51ef',
  u'type': u'people',
  u'url': u'http://www.zhihu.com/api/v4/people/777af5ef2077a8474fb9372b3eee0df7',
  u'url_token': u'zhang-kai-06-10',
  u'user_type': u'people'},
 u'can_comment': {u'reason': u'', u'status': True},
 u'comment_count': 40,
 u'comment_permission': u'all',
 u'created_time': 1420811134,
 u'excerpt': u'\u4e0d\u4e00\u6837 ----\u7b54\u6848\u5c31\u662f\u8fd9\u4e48\u7b80\u5355----- \u672c\u4eba\u521d\u4e2d\u4e00\u5206\u6821\uff0c\u9ad8\u4e2d\u672c\u90e8\uff0c\u5bb6\u8fb9\u4e0a\u4e8c\u5206\u6821\uff0c\u5173\u7cfb\u6700\u597d\u7684\u8001\u5e08\u73b0\u5728\u671d\u9633\u5206\u6821\uff0c\u524d\u6bb5\u65f6\u95f4\u6709\u5e78\u53bb\u7fe0\u5fae\u5206\u6821\u4f20\u6388\u4e86\u4e00\u4e0b\u7ecf\u9a8c\uff0c\u6240\u4ee5\uff0c\u8c8c\u4f3c\u8fd8\u80fd\u7b54\u7684\u5168\u9762\u3002 \uff08\u56fe\u7247\u767e\u5ea6\u641c\u51fa\u6765\u7684\uff0c\u6240\u4ee5\u5982\u6709\u4fb5\u6743\u8bf7\u79c1\u4fe1\u6211\uff09 \u4e00\u5206\u6821\uff0c\u539f\u897f\u9890\u4e2d\u5b66\uff08\u5e94\u8be5\u662f\uff09\uff0c\u2026',
 u'extras': u'',
 u'id': 36871741,
 u'is_collapsed': False,
 u'is_copyable': True,
 u'question': {u'author': {u'avatar_url': u'https://pic4.zhimg.com/f38543fcb_is.jpg',
   u'avatar_url_template': u'https://pic4.zhimg.com/f38543fcb_{size}.jpg',
   u'badge': [],
   u'gender': 1,
   u'headline': u'\u7231\u6298\u817e\u7684\u7f16\u7a0b\u7231\u597d\u8005',
   u'id': u'fa41e042c407aa164ce06cb27af397a1',
   u'is_advertiser': False,
   u'is_followed': False,
   u'is_following': False,
   u'is_org': False,
   u'name': u'Paul Wu',
   u'type': u'people',
   u'url': u'http://www.zhihu.com/api/v4/people/fa41e042c407aa164ce06cb27af397a1',
   u'url_token': u'paul-wu',
   u'user_type': u'people'},
  u'created': 1338818478,
  u'id': 20277085,
  u'question_type': u'normal',
  u'title': u'\u5317\u4eac\u5f88\u591a\u4e2d\u5b66\u90fd\u5f00\u8bbe\u5206\u6821\uff0c\u8fd9\u4e9b\u5206\u6821\u7684\u6559\u5b66\u8d28\u91cf\u548c\u603b\u90e8\u4e00\u6837\u5417\uff1f\u6bd4\u5982\u4eba\u5927\u9644\u4e2d\u671d\u9633\u5b66\u6821',
  u'type': u'question',
  u'updated_time': 1338818478,
  u'url': u'http://www.zhihu.com/api/v4/questions/20277085'},
 u'suggest_edit': {u'reason': u'',
  u'status': False,
  u'tip': u'',
  u'title': u'',
  u'unnormal_details': {},
  u'url': u''},
 u'thanks_count': 19,
 u'thumbnail': u'https://pic3.zhimg.com/19226548100d4b41d40c472d21541e0a_200x112.jpg',
 u'type': u'answer',
 u'updated_time': 1420812467,
 u'url': u'http://www.zhihu.com/api/v4/answers/36871741',
 u'voteup_count': 51}

In [19]:
ans = get_data_from_zhihu_api(zhihu_api_questions_answers,20277085)

In [27]:
print ans['items'][0]['content']


不一样<br>----答案就是这么简单-----<br>本人初中一分校,高中本部,家边上二分校,关系最好的老师现在朝阳分校,前段时间有幸去翠微分校传授了一下经验,所以,貌似还能答的全面。<br>(图片百度搜出来的,所以如有侵权请私信我)<br><br><ul><li>一分校,原西颐中学(应该是),本人上初一的时候刚刚三年的学生大团圆,个人认为师资是非常好的,拜刘彦校长(?)所赐,再加之是第一所分校,基本上本校好的老师调来不少。初中班主任是带完本部高三下来(而且还是10班),初二语文老师换成了本校语文组的得力干将,第一届就一举送了近50个学生到本部,于是一下分校就火了,高中分校人少,不过老师也还是很不错,都是本部调来的很好的老师。<b>师资最好,和本部的联系最紧密(初中部尤甚),现在初高中老师们都会去本部参加每周的教学讨论,初三的话是能够有资格参与本校150名(?)以内保送本部的。</b><br></li></ul><noscript><img src="https://pic3.zhimg.com/19226548100d4b41d40c472d21541e0a_b.jpg" data-rawwidth="1062" data-rawheight="631" class="origin_image zh-lightbox-thumb" width="1062" data-original="https://pic3.zhimg.com/19226548100d4b41d40c472d21541e0a_r.jpg">(懒得从硬盘翻了,去官网找了这么一张)</noscript><img src="//zhstatic.zhihu.com/assets/zhihu/ztext/whitedot.jpg" data-rawwidth="1062" data-rawheight="631" class="origin_image zh-lightbox-thumb lazy" width="1062" data-original="https://pic3.zhimg.com/19226548100d4b41d40c472d21541e0a_r.jpg" data-actualsrc="https://pic3.zhimg.com/19226548100d4b41d40c472d21541e0a_b.jpg">(懒得从硬盘翻了,去官网找了这么一张)<br>【更正】此处有我的(女)朋友提醒,现在初高中老师都是去参加本部教学讨论的,并且高中师资也是很好的<br><ul><li>二分校,原蓝靛厂中学,近两年才接管,所以生源并不是太好,不过听说初中要分片入学了,看来会有不少好学生不甘堕落来上二分了。二分在大型的教学活动,比如区统考之类的,会来本部一起参与教学讨论,但此时刘校的布局就已经很宏大了,所以只有骨干的老师是本部的得力教师,剩余的还是保留的蓝靛厂中学的优秀教师。<b>师资次于二分校,和本部的联系较为紧密,初三的保送应该是有,但是名额较少(主要是学生水平问题)。</b><br></li></ul><noscript><img src="https://pic2.zhimg.com/3d71ea30ae4c224e9a56f1b01c7eabb5_b.jpg" data-rawwidth="800" data-rawheight="538" class="origin_image zh-lightbox-thumb" width="800" data-original="https://pic2.zhimg.com/3d71ea30ae4c224e9a56f1b01c7eabb5_r.jpg"></noscript><img src="//zhstatic.zhihu.com/assets/zhihu/ztext/whitedot.jpg" data-rawwidth="800" data-rawheight="538" class="origin_image zh-lightbox-thumb lazy" width="800" data-original="https://pic2.zhimg.com/3d71ea30ae4c224e9a56f1b01c7eabb5_r.jpg" data-actualsrc="https://pic2.zhimg.com/3d71ea30ae4c224e9a56f1b01c7eabb5_b.jpg"><br><ul><li>翠微分校,原翠微学校(还是卫国中学,还是和卫国中学合作?),今年才接管,所以目前发展的并不太好,但是派过去的老师可以说是骨干了,好像还从别的学校挖了一些老师过来,就是目前学生质量不太好,可能学习气氛会不是很好,但是老师质量还是不错。<b>师资跟二分校差不多,没准高中还能更强一点,教学水平可能还要再等两年看看。</b></li></ul><noscript><img src="https://pic1.zhimg.com/30709b199e650fde45c91f82cfb4f950_b.jpg" data-rawwidth="640" data-rawheight="480" class="origin_image zh-lightbox-thumb" width="640" data-original="https://pic1.zhimg.com/30709b199e650fde45c91f82cfb4f950_r.jpg"></noscript><img src="//zhstatic.zhihu.com/assets/zhihu/ztext/whitedot.jpg" data-rawwidth="640" data-rawheight="480" class="origin_image zh-lightbox-thumb lazy" width="640" data-original="https://pic1.zhimg.com/30709b199e650fde45c91f82cfb4f950_r.jpg" data-actualsrc="https://pic1.zhimg.com/30709b199e650fde45c91f82cfb4f950_b.jpg"><br><ul><li>朝阳分校,原(who knows),<b>这是一所不一样的分校</b>,它的高中更倾向于A-level课程类型的,英语教学很多,如果专攻出国朝阳分校是个很好的选择。所以它的导向就反映在了师资上,老师们都比较年轻,充满教学的热情,很有活力,如果在高中部,还有很多外教,所以圣诞节会调休放假。<b>师资什么的没法比较,毕竟定位不同,不过老师们都很有活力很有想法,能够创新,所以,如果有这个方向发展的需要……</b></li></ul><noscript><img src="https://pic3.zhimg.com/e7fe5d3417f5c8b7a845fdd638388332_b.jpg" data-rawwidth="695" data-rawheight="420" class="origin_image zh-lightbox-thumb" width="695" data-original="https://pic3.zhimg.com/e7fe5d3417f5c8b7a845fdd638388332_r.jpg"></noscript><img src="//zhstatic.zhihu.com/assets/zhihu/ztext/whitedot.jpg" data-rawwidth="695" data-rawheight="420" class="origin_image zh-lightbox-thumb lazy" width="695" data-original="https://pic3.zhimg.com/e7fe5d3417f5c8b7a845fdd638388332_r.jpg" data-actualsrc="https://pic3.zhimg.com/e7fe5d3417f5c8b7a845fdd638388332_b.jpg"><br><b>【更正】评论里有人告诉我朝阳学校和朝阳分校不是一个学校我都吓尿了,刘校下的棋太大,已超越了我的掌握范围</b><br><ul><li>西山分校,只在苹果官网上见过,不过要知道我们学校玩科技牌,那是只要你有兴趣不愁资源的,放心啦,那不是家长捐的,那是和苹果合作。<b>结合科技的教育,全世界都在探索,be patient,不过要想摆弄程序啥的起家,西山分校估计还真是个好选择。</b></li></ul><noscript><img src="https://pic1.zhimg.com/1f16b2816ef7ad550189253fa669a280_b.jpg" data-rawwidth="1440" data-rawheight="753" class="origin_image zh-lightbox-thumb" width="1440" data-original="https://pic1.zhimg.com/1f16b2816ef7ad550189253fa669a280_r.jpg">看到这个主页我都被吓尿了,不愧是苹果门徒</noscript><img src="//zhstatic.zhihu.com/assets/zhihu/ztext/whitedot.jpg" data-rawwidth="1440" data-rawheight="753" class="origin_image zh-lightbox-thumb lazy" width="1440" data-original="https://pic1.zhimg.com/1f16b2816ef7ad550189253fa669a280_r.jpg" data-actualsrc="https://pic1.zhimg.com/1f16b2816ef7ad550189253fa669a280_b.jpg">看到这个主页我都被吓尿了,不愧是苹果门徒<br><ul><li>美国分校,这个应该是和普林斯顿一起办的,没去过,自然不知,不过听说要在国内和普林斯顿合建一个爱文国际学校,谁知道</li><br><li>太空分校,这个建的还不太好,目前小有成果就是给全国同学进行了一场太空授课的直播,师资力量也不行,只有王亚平一个实验老师,就还有几个开飞船的,剩下的还要从本部抽调一个宓奇老师进行交流。设施也不行,可能还得等天宫建一建才行<br></li></ul><noscript><img src="https://pic1.zhimg.com/baa5e78a93aa96e7dff9c8371c99d610_b.jpg" data-rawwidth="900" data-rawheight="600" class="origin_image zh-lightbox-thumb" width="900" data-original="https://pic1.zhimg.com/baa5e78a93aa96e7dff9c8371c99d610_r.jpg"></noscript><img src="//zhstatic.zhihu.com/assets/zhihu/ztext/whitedot.jpg" data-rawwidth="900" data-rawheight="600" class="origin_image zh-lightbox-thumb lazy" width="900" data-original="https://pic1.zhimg.com/baa5e78a93aa96e7dff9c8371c99d610_r.jpg" data-actualsrc="https://pic1.zhimg.com/baa5e78a93aa96e7dff9c8371c99d610_b.jpg"><br><br><br><b>不同的分校招收不同的人才,培养不同的人才</b><br><b>你们不知道,刘校在下一盘很大的棋</b>

In [ ]: