#!/usr/bin/python3
import requests
import json
link = "https://api-zero.livere.com/v1/comments/list?callback=jQuery112401306523037356928_1621511074326&limit \
=10&repSeq=4272904&requestPath=%2Fv1%2Fcomments%2Flist&consumerSeq=1020&livereSeq=28583&smartloginSeq= \
5154&code=&_=1621511074328"
header = {
'User-Agent' : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36"
}
r = requests.get(link, headers= header)
json_string = r.text
json_string = json_string[json_string.find('{'):-2]
json_data = json.loads(json_string)
comment_list = json_data['results']['parents']
for eachone in comment_list:
message = eachone['content']
print(message)
python学习---隐藏链接评论内容爬取
最新推荐文章于 2023-07-19 15:48:41 发布