Created
November 23, 2016 11:44
-
-
Save I0x0I/a324eb67bd40ee1383d99d48171b4d4e to your computer and use it in GitHub Desktop.
Script for zhihu.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
method = 'POST' | |
url = 'https://www.zhihu.com/node/QuestionAnswerListV2' | |
headers = {'Origin': 'https://www.zhihu.com', 'Content-Length': '93', 'Accept-Language': 'en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4', 'Accept-Encoding': 'gzip, deflate, br', 'Connection': 'keep-alive', 'Accept': '*/*', 'User-Agent': 'Mozilla/5.0(Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36', 'Host': 'www.zhihu.com', 'X-Requested-With': 'XMLHttpRequest', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache', 'Referer': 'https://www.zhihu.com/question/19563390', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'Cookie': 'd_c0="ACBCIuNN5AqPTukv-7RO2Eqf2ixB8sRZkh8=|1479899930"; q_c1=650fee33b22647cfa5c335eb424ed790|1479899930000|1479899930000; l_cap_id="NzU3NzQ4YmMyNTgxNDEyNjk1NjkwODk2YjBlMzJiYTk=|1479899930|6e41c4f08075457e53f3d37650e2cff841596ce5"; cap_id="NmZkMDYyMTU5NjAxNGVjMmIxOTE1YjVjNzhhZWI2Mjc=|1479899930|365f20a0d522da2b6a8122e940426e3a31f624e8"; n_c=1'} | |
data = 'method=next¶ms=%7B%22url_token%22%3A'+'19563390'+'%2C%22pagesize%22%3A10%2C%22offset%22%3A'+'10'+'%7D' | |
res = requests.request(url=url,method=method,data=data,headers=headers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment