当前位置:网站首页>Baidu knows the crawler, and obtains the dialogue below the comment according to the question Id, clue ID and comment ID
Baidu knows the crawler, and obtains the dialogue below the comment according to the question Id, clue ID and comment ID
2022-06-28 23:24: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)
边栏推荐
- 油猴脚本学习
- fio的IO重放功能
- 【SSM】报错 Access denied for user ‘WYF‘@‘localhost‘ (using password: YES) 数据的用户名变成了电脑的用户名
- Ahai's advice
- What will be done after digital IC Verification?
- Puma joins hands with 10ktf shop to launch its Web3 cooperation project with the largest scale so far
- 运维排查-使用hcache插件排查Buffer/cache占用过高
- C语言-单词分析解析
- 移动端异构运算技术 - GPU OpenCL 编程(基础篇)
- 计数排序和排序的稳定性
猜你喜欢

Interviewer: what is the internal implementation of strings in redis?

计数排序和排序的稳定性

Cs5463 code module analysis (including download link)

2022年PMP项目管理考试敏捷知识点(4)

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

CS5463代码模块解析(包含下载链接)

PHP 使用endroid/qrcode 二维码生成, GD库生成分享海报

Chapter IV memory management exercise

Machine learning 4-dimension reduction technology

两栏布局左边图片显示部分由右边内容高度决定
随机推荐
计数排序和排序的稳定性
表单校验问题——el-select(初始化页面自动触发校验解决办法)
华为22级专家十年心血终成云原生服务网格进阶实战文档,是真的6
[数学建模]Matlab非线性规划之fmincon()函数
That's how he did it!
第四章 存储器管理练习
2022年PMP项目管理考试敏捷知识点(4)
WEB API学习笔记1
Three communication skills in software testing
[matlab]函数定义与使用
Machine learning 6-decision tree
PHP利用CURL实现登录网站后下载Excel文件
Do you know all the wonderful functions of the vlookup function?
What will be done after digital IC Verification?
[Chapter 2 of word tutorial series] how to set the table on each page to have a header in word
Didn't find an internship. He summed it up
Encounter with avita 11: long lost freshness under strong product power
Class extension and optional type extension of dart
Cmake tutorial (I)
他原来是这么刷题的!