0
對zhihu,中文問答&與Quora類似的社區,我正在編寫一個小程序,用於創建關注特定用戶的用戶列表。在顯示此信息的頁面上,通過向下滾動到底部,瀏覽器發送發佈請求並在json中接收響應以擴展關注者列表。使用Python請求接收到空的Json響應
接收到的JSON的代碼段(從螢火蟲複製):
{"r":0,"msg":["<div class=\"zm-profile-card zm-profile-section-item zg-clear no-hovercard\">\n<div class=\"zg-right\">\n<button data-follow=\"m:button\" data-id=\"f09ebe71535bd89a43dd979c77cf3676\" class=\"zg-btn zg-btn-unfollow zm-rich-follow-btn small nth-0\">\u53d6\u6d88\u5173\u6ce8<\/button>.....
我對JSON的小知識,但我相信,「味精」包含關於追隨者的信息。
在我的程序中,我使用Python Requests module將此帖子請求發送到服務器。
payload={"method":"next","params":params,"_xsrf":_xsrf}#form data
response=session.post('http://www.zhihu.com/node/ProfileFollowersListV2',data=payload,headers=header)
響應具有狀態碼200,但response.json()返回:
{u'msg': [], u'r': 0}
其中 'MSG' 是空的。誰能幫我這個?
你確定它是POST而不是GET瀏覽器在做什麼? – 2015-01-21 06:36:51
看起來您應該註冊並登錄才能查看某個人的關注者。對? – alecxe 2015-01-21 06:37:21
感謝您的意見。我確信這是POST請求,因爲我在螢火蟲中看到它。 – user3571189 2015-01-21 14:22:19