import requests
import json
file = open('venv/text/comment_new3.doc','a')
resp = requests.get('https://club.jd.com/comment/productPageComments.action?callback=fetchJSON_comment98&productId=100008348542&score=0&sortType=5&page=0&pageSize=10&isShadowSku=0&fold=1')
resp = resp.text.replace('fetchJSON_comment98(','').replace(');','')
json_data = json.loads(resp)
comments = json_data['comments']
for item in comments:
id = item['id']
guid = item['guid']
content = " " +item['content'] + '\n\n'
file.write(content)
转载请注明原文地址:https://blackberry.8miu.com/read-29975.html