我在爬头条新闻评论时遇到一个奇怪的问题,用 postman 模拟请求可以正常获得数据, 但用 python requests 模块写的请求获取到的数据总是空的,有返回信息,但里面没有有用的价值。 接口类似于这种: https://www.toutiao.com/api/comment/list/?group_id=6533396129860551182&item_id=6533396129860551182
postman 返回数据: { message: "success", data: { has_more: true, total: 65, comments: [ { text: "充电一回,能用半年,我们就买。", digg_count: 293, reply_data: { reply_list: [ ] }, ....省略很多}
python 程序返回数据: {"message": "success", "data": { "has_more": false, "total": 0, "comments": []}}