#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: LoveNight
# @Date: 2015-12-01 12:12:05
import requests
import json
import re
url = r'http://xxx'
resData = requests.get(url).text
jsonStr = re.findall(r'fetchJSON_comment98vv1851\((.*?)\)', resData)[0]
data = json.loads(jsonStr)
summary = data["productCommentSummary"]
print("全部评价", summary["commentCount"], "好评", summary["goodCount"],
"中评", summary["generalCount"], "差评", summary["poorCount"],
"有图片的评价", summary["showCount"])
print("第一条:")
first = data["comments"][0]
print("评论:", first["content"])
print("时间:", first["creationTime"])
print("购买信息", first["productSize"])
print("回复:", first["replyCount"])
print("赞:", first["usefulVoteCount"])
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)