Skip to content

Instantly share code, notes, and snippets.

@Azureki
Created September 1, 2019 10:52
Show Gist options
  • Select an option

  • Save Azureki/58901050c452d5f28052e6c3a51aa0dc to your computer and use it in GitHub Desktop.

Select an option

Save Azureki/58901050c452d5f28052e6c3a51aa0dc to your computer and use it in GitHub Desktop.
Test zhihu api.
import requests
import json
url = 'https://www.zhihu.com/api/v4/members/xu-guo-xi/activities?limit=7'
headers = {
'x-api-version': '3.0.40',
'x-udid': 'AMAiMrPqqQ2PTnOxAr5M71LCh-dIQ8kkYvw=',
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0'
}
res = requests.get(url, headers=headers)
d = json.loads(res.text)
print(len(d['data']))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment