火车采集器软件交流官方论坛

 找回密码
 加入会员
搜索
火车采集器V9版免费下载火车浏览器 - 可视采集,万能群发,全自动脚本工具
查看: 4565|回复: 2

如何用正则采集这个标签?

[复制链接]
发表于 2013-3-8 14:40:21 | 显示全部楼层 |阅读模式
1火车车厢
"farePrice":490.0,"fuelSurcharge":140.0,"marketFare":490.0,"otherCharges":0.0,"pnCMBCardMile":0.0,"policyNo":null,"remark":null,"returnPoint":0.0,"total":680.0},"adultFareIntl":null,"airlineCode":"JD","childFare":{"airportTax":0.0,"commission":{"agentFee":0.0,"agentPer":0.0,"policyCreateDate":null,"policyNo":null,"spFee":0.0,"spPer":0.0},"farePrice":490.0,"fuelSurcharge":70.0,"marketFare":490.0,"otherCharges":0.0,"pnCMBCardMile":0.0,"policyNo":null,"remark":null,"returnPoint":0.0,"total":560.0},"childFareIntl":null,"code":"WZZX","createDate":"2011-03-27T20:41:11","createId":"JD_CJH","description":"联动下浮","ei":"不得签转、仅限网站退票



以上这段代码,我想采集 开头的"farePrice":490.0 这里的490作为“价格”标签,但是这段代码是JSON里的数据,相同的代码有很多条,唯一能标识不同的就是  "code":"WZZX"

请问如何写一个正确的正则采集内容?

 楼主| 发表于 2013-3-8 15:06:59 | 显示全部楼层
通过群里的大哥耐心的帮我解决了问题。
正则表达式如下:
  1. WZZX.*?farePrice":(?<content>[\d.]+),".{170,180}WZZX
复制代码
发表于 2013-3-9 15:22:20 | 显示全部楼层
你好,请联系QQ:1197089128,专业采集
您需要登录后才可以回帖 登录 | 加入会员

本版积分规则

QQ|手机版|Archiver|火车采集器官方站 ( 皖ICP备06000549 )

GMT+8, 2024-11-24 14:37

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表