37,722
社区成员
发帖
与我相关
我的任务
分享
import requests
s = requests.session()
headers = {
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'authorization': 'oauth c3cef7c66a1843f8b3a9e6a1e3160e20',
'Connection': 'keep-alive',
'Host': 'www.zhihu.com',
'Referer': 'https://zhuanlan.zhihu.com/p/30922625',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36'
}
s.headers = headers
res = s.get('https://www.zhihu.com/explore')
res.encoding = 'utf-8'
print(res.text)