Closed k3rw1n closed 4 years ago
你提取的数据里面也是有数值的,并不是0,如果json看起来比较吃力,可以使用JSON格式化工具。 以下是我刚提取的信息,如果仍有问题,请附上你的请求参数以便进一步判断。
{
"results": [{
"infectSource": "野生动物,可能为中华菊头蝠",
"passWay": "经呼吸道飞沫传播,亦可通过接触传播",
"dailyPic": "https://img1.dxycdn.com/2020/0128/202/3393406768163357387-73.jpg",
"summary": "",
"countRemark": "",
"confirmedCount": 4629,
"suspectedCount": 6973,
"curedCount": 71,
"deadCount": 106,
"virus": "新型冠状病毒 2019-nCoV",
"remark1": "易感人群: 人群普遍易感。老年人及有基础疾病者感染后病情较重,儿童及婴幼儿也有发病",
"remark2": "潜伏期: 一般为 3~7 天,最长不超过 14 天,潜伏期内存在传染性",
"remark3": "",
"remark4": "",
"remark5": "",
"generalRemark": "疑似病例数来自国家卫健委数据,目前为全国数据,未分省市自治区等",
"abroadRemark": "",
"updateTime": 1580213249160,
"confirmed": 0,
"suspect": 0,
"cured": 0,
"death": 0
}],
"success": true
}
请使用confirmedCount
/suspectedCount
/curedCount
/deadCount
,confirmed
等变量是丁香园没有直接给定变量名的时候我用正则表达式提取的。
现在丁香园直接将confirmedCount
渲染在静态页面,让前端来解析,而不提供countRemark
。
TODO
overall_parser
。TODO
- 整理overall数据,保证变量名的连贯性;
- 审查
overall_parser
。
已完成,丁香园原本未提供数据,只通过countRemark
将数字静态渲染在字符串中,我通过正在表达式提取数值并储存在confirmed
等字段中。自28日起丁香园直接将confirmedCount
作为字段传递至前端,由前端完成渲染工作,因此正则表达式匹配失败,数值为空。
目前,所有数据均以按照丁香园的命名规范confirmedCount
存储,所有历史数据字段重命名完成,已检查数据连贯性。
{"infectSource": "野生动物,可能为中华菊头蝠", "passWay": "经呼吸道飞沫传播,亦可通过接触传播", "dailyPic": "https://img1.dxycdn.com/2020/0128/202/3393406768163357387-73.jpg", "summary": "", "countRemark": "", "confirmedCount": 4597, "suspectedCount": 6973, "curedCount": 67, "deadCount": 106, "virus": "新型冠状病毒 2019-nCoV", "remark1": "易感人群: 人群普遍易感。老年人及有基础疾病者感染后病情较重,儿童及婴幼儿也有发病", "remark2": "潜伏期: 一般为 3~7 天,最长不超过 14 天,潜伏期内存在传染性", "remark3": "", "remark4": "", "remark5": "", "generalRemark": "疑似病例数来自国家卫健委数据,目前为全国数据,未分省市自治区等", "abroadRemark": "", "updateTime": 1580200638128, "confirmed": 0, "suspect": 0, "cured": 0, "death": 0}, {"infectSource": "野生动物,可能为中华菊头蝠", "passWay": "经呼吸道飞沫传播,亦可通过接触传播", "dailyPic": "https://img1.dxycdn.com/2020/0128/202/3393406768163357387-73.jpg", "summary": "", "countRemark": "", "confirmedCount": 4597, "suspectedCount": 6973, "curedCount": 68, "deadCount": 106, "virus": "新型冠状病毒 2019-nCoV", "remark1": "易感人群: 人群普遍易感。老年人及有基础疾病者感染后病情较重,儿童及婴幼儿也有发病", "remark2": "潜伏期: 一般为 3~7 天,最长不超过 14 天,潜伏期内存在传染性", "remark3": "", "remark4": "", "remark5": "", "generalRemark": "疑似病例数来自国家卫健委数据,目前为全国数据,未分省市自治区等", "abroadRemark": "", "updateTime": 1580201486948, "confirmed": 0, "suspect": 0, "cured": 0, "death": 0}, {"infectSource": "野生动物,可能为中华菊头蝠", "passWay": "经呼吸道飞沫传播,亦可通过接触传播", "dailyPic": "https://img1.dxycdn.com/2020/0128/202/3393406768163357387-73.jpg", "summary": "", "countRemark": "", "confirmedCount": 4599, "suspectedCount": 6973, "curedCount": 68, "deadCount": 106, "virus": "新型冠状病毒 2019-nCoV", "remark1": "易感人群: 人群普遍易感。老年人及有基础疾病者感染后病情较重,儿童及婴幼儿也有发病", "remark2": "潜伏期: 一般为 3~7 天,最长不超过 14 天,潜伏期内存在传染性", "remark3": "", "remark4": "", "remark5": "", "generalRemark": "疑似病例数来自国家卫健委数据,目前为全国数据,未分省市自治区等", "abroadRemark": "", "updateTime": 1580202032520, "confirmed": 0, "suspect": 0, "cured": 0, "death": 0}, {"infectSource": "野生动物,可能为中华菊头蝠", "passWay": "经呼吸道飞沫传播,亦可通过接触传播", "dailyPic": "https://img1.dxycdn.com/2020/0128/202/3393406768163357387-73.jpg", "summary": "", "countRemark": "", "confirmedCount": 4618, "suspectedCount": 6973, "curedCount": 69, "deadCount": 106, "virus": "新型冠状病毒 2019-nCoV", "remark1": "易感人群: 人群普遍易感。老年人及有基础疾病者感染后病情较重,儿童及婴幼儿也有发病", "remark2": "潜伏期: 一般为 3~7 天,最长不超过 14 天,潜伏期内存在传染性", "remark3": "", "remark4": "", "remark5": "", "generalRemark": "疑似病例数来自国家卫健委数据,目前为全国数据,未分省市自治区等", "abroadRemark": "", "updateTime": 1580207852419, "confirmed": 0, "suspect": 0, "cured": 0, "death": 0}, {"infectSource": "野生动物,可能为中华菊头蝠", "passWay": "经呼吸道飞沫传播,亦可通过接触传播", "dailyPic": "https://img1.dxycdn.com/2020/0128/202/3393406768163357387-73.jpg", "summary": "", "countRemark": "", "confirmedCount": 4622, "suspectedCount": 6973, "curedCount": 71, "deadCount": 106, "virus": "新型冠状病毒 2019-nCoV", "remark1": "易感人群: 人群普遍易感。老年人及有基础疾病者感染后病情较重,儿童及婴幼儿也有发病", "remark2": "潜伏期: 一般为 3~7 天,最长不超过 14 天,潜伏期内存在传染性", "remark3": "", "remark4": "", "remark5": "", "generalRemark": "疑似病例数来自国家卫健委数据,目前为全国数据,未分省市自治区等", "abroadRemark": "", "updateTime": 1580212278503, "confirmed": 0, "suspect": 0, "cured": 0, "death": 0}], "success": true}