当前位置:网站首页>百度知道爬虫,根据问题id,线索id,评论id获取评论下面的对话
百度知道爬虫,根据问题id,线索id,评论id获取评论下面的对话
2022-06-28 23:21:00 【supramolecular】
import requests
import time
import math
import demjson
comment_request = [{'thread_id': '11817919873', 'qid': '96177926', 'rid': '2954479968'}, {'thread_id': '1260090477', 'qid': '96177926', 'rid': '315022619'}, {'thread_id': '1260687497', 'qid': '96177926', 'rid': '315171874'}, {'thread_id': '11734823241', 'qid': '96177926', 'rid': '2933705810'}, {'thread_id': '1260108277', 'qid': '96177926', 'rid': '315027069'}]
def get_new_comment(param):
t = str(math.floor(time.time()))
# url = "https://zhidao.baidu.com/api/comment?method=get_new_comment&app=qb&thread_id=1260090477&qid=96177926&rid=2954479968"
url = "https://zhidao.baidu.com/api/comment?method=get_new_comment&app=qb&thread_id=" + param['thread_id'] + "&qid=" + param['qid'] + "&rid=" + param['rid'] + "&pn=0&rn=10&r=" + t
print(url)
# url = "https://zhidao.baidu.com/api/comment?method=get_new_comment&app=qb&thread_id=11817919873&qid=96177926&rid=2954479968&pn=0&rn=10&r=" + t
resp = requests.post(url)
comment = resp.json()
if comment['data']['comment_count'] != None:
for item in comment['data']['comment_list']:
str_create_time = item['str_create_time']
content = item['content']
from_uname = item['from_uname']
from_uid = item['from_uid']
to_uid = item['to_uid']
id = param['rid']
print(str_create_time, content, from_uname, from_uid, to_uid, id)
for req in comment_request:
get_new_comment(req)
边栏推荐
- 全面掌握const的用法《一》
- At the end of June, how many people in Kangkang are ready to change jobs
- mysql-5.7.30-winx64免安装版下载安装教程
- 在DialogFragment的onStop(完全不可见)时调用dismiss退出界面报错解决办法
- Lost in cloud computing
- Is the account opening of Guosheng securities really safe and reliable
- 机器学习4-降维技术
- VSCode里使用条件断点(基于GDB)
- 两栏布局左边图片显示部分由右边内容高度决定
- 【OpenCV】—线性滤波:方框滤波、均值滤波、高斯滤波
猜你喜欢

Linq连表查询
![LeetCode 324 擺動排序 II[排序 雙指針] HERODING的LeetCode之路](/img/41/b8ba8d771b7224eac1cc8c54fe9d29.png)
LeetCode 324 擺動排序 II[排序 雙指針] HERODING的LeetCode之路

keil工程,程序写多后,RTT不能打印

Use conditional breakpoints in vscode (based on GDB)

ROS2中的行为树 BehaviorTree

Keil project, RTT cannot print after too many programs are written

See fengzhixia | FENGZikai, the originator of Guoman, for exclusive sale of Digital Collections

mysql-5.7.30-winx64免安装版下载安装教程

YuMinHong set up two funds funded by his hometown
![[API packet capturing in selenium automation] installation and configuration of browsermobproxy](/img/67/3e15b2191ee23a8c4453aad007651d.png)
[API packet capturing in selenium automation] installation and configuration of browsermobproxy
随机推荐
小样本利器2.文本对抗+半监督 FGSM & VAT & FGM代码实现
Hit the industry directly | the flying propeller launched the industry's first model selection tool
WEB API学习笔记1
计数排序和排序的稳定性
Small sample sharp weapon 2 Text confrontation + semi supervised FGSM & VAT & FGM code implementation
这样学习二叉树
Use conditional breakpoints in vscode (based on GDB)
全面掌握const的用法《一》
【剑指Offer】50. 第一个只出现一次的字符
收藏 | VLOOKUP函数的这些妙用你都知道吗?
Counting sorting and stability of sorting
Mathematical knowledge: finding combinatorial number I - finding combinatorial number
关联线探究,如何连接流程图的两个节点
Chapter II Classic synchronous exercises
Non scientific class! The road of self-study!
表单校验问题——el-select(初始化页面自动触发校验解决办法)
Is the account opening of Guosheng securities really safe and reliable
Chapter III processor scheduling exercise
Form verification problem - El select (solution to automatically trigger verification on initialization page)
Wechat red envelope cover making tutorial and use guide with link jump