Created
September 1, 2019 10:52
-
-
Save Azureki/58901050c452d5f28052e6c3a51aa0dc to your computer and use it in GitHub Desktop.
Test zhihu api.
This file contains hidden or 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 | |
| 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