Skip to content

Instantly share code, notes, and snippets.

@I0x0I
Created November 23, 2016 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save I0x0I/a324eb67bd40ee1383d99d48171b4d4e to your computer and use it in GitHub Desktop.
Save I0x0I/a324eb67bd40ee1383d99d48171b4d4e to your computer and use it in GitHub Desktop.
Script for zhihu.com
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&params=%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