我一直在使用以下端点通过 Python requests 通过用户名获取用户数据。
https://{defaultHost}/u/{username}.json
最近,我发现通过 Python requests 返回的数据与在浏览器中输入相同 URL 时返回的数据不同。
这是一个例子:
https://forum.leasehackr.com/u/jalopspecial.json
在浏览器中,我得到了用户的完整数据集。如果我通过 Python requests 使用相同的端点请求数据:
user_url = https://forum.leasehackr.com/u/jalopspecial.json
user_profile_request = requests.get(user_url)
user_profile = user_profile_request.json()
我只得到:
{'user': {'avatar_template': '/user_avatar/forum.leasehackr.com/jalopspecial/{size}/92094_2.png',
'id': 11498,
'name': 'Whitt',
'primary_group_name': 'supporters',
'profile_hidden': True,
'title': 'Supporter',
'username': 'JalopSpecial'}}
过去并非如此。有什么变化吗?感谢您的帮助!![]()