当前位置:网站首页>百度知道爬虫,根据问题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)
边栏推荐
- 设计电商秒杀系统
- WEB API学习笔记1
- Insomnia last night
- 网上注册股票开户很困难么?在线开户是安全么?
- [flutter issues Series title 71] Mutual Conversion between uint8list and Image in flutter
- Hesitating root sound
- 关联线探究,如何连接流程图的两个节点
- Undefined symbol main (referred from entry9a.o).
- I can't sleep
- 【SSM】报错 Access denied for user ‘WYF‘@‘localhost‘ (using password: YES) 数据的用户名变成了电脑的用户名
猜你喜欢

CIN at QT (the clearest tutorial in the whole network)

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

Machine learning 4-dimension reduction technology

note

【Word 教程系列第 1 篇】如何去除 Word 表格中的箭头
![[conception de la machine d'état] Moore, Mealy State Machine, Three - stage, Two - stage, one - stage State Machine Writing Specification](/img/48/e29f34aff7cc437bfb574591d54e3d.png)
[conception de la machine d'état] Moore, Mealy State Machine, Three - stage, Two - stage, one - stage State Machine Writing Specification

ROS2中的行为树 BehaviorTree

Cs5463 code module analysis (including download link)

Linq连表查询

CS5463代码模块解析(包含下载链接)
随机推荐
Encounter with avita 11: long lost freshness under strong product power
SqlServer复习
Small sample sharp weapon 2 Text confrontation + semi supervised FGSM & VAT & FGM code implementation
Form verification problem - El select (solution to automatically trigger verification on initialization page)
Online sql to htmltable tool
这样学习二叉树
I can't sleep
[API packet capturing in selenium automation] installation and configuration of browsermobproxy
Online linear programming: Dual convergence, new algorithms, and regret bounds
MSCI 2022 market classification assessment
Understand shell script in one article
[deep learning] (3) encoder mechanism in transformer, complete pytoch code attached
ROS2中的行为树 BehaviorTree
论文解读(DCN)《Towards K-means-friendly Spaces: Simultaneous Deep Learning and Clustering》
WEB API学习笔记1
See fengzhixia | FENGZikai, the originator of Guoman, for exclusive sale of Digital Collections
老家出资,俞敏洪设立两支基金
lock4j--分布式锁中间件--使用/实例
Would like to ask, how to open a stock account? Is it safe to open an account online?
Online text filter less than specified length tool