目录
Fiddler安装
手机wife设置
解析包信息
python爬取代码:
下载:https://www.telerik.com/download/fiddler
安装
配置选项
这个很必要,电脑否则不能上网
用谷歌浏览器访问,获取证书 http://localhost:8888/
手机电脑浏览器都要装,发给手机并安装,点下面的安卓机器人
手机要使用电脑的ip做代理,这样手机的数据才会被fiddler抓到,手机电脑用同一个wife
手机wife高级设置如下,端口要没被占用的
安装结束,使用手机访问网络,Fillder就会获取到数据包,如果手机没网络,就重启Fillder
获取数据包与网页无异,补全头信息即可
比如这个数据包
import urllib2
import requests
import json
url = "https://api.jingchengcaidian.com/api/Category/getCategoryName?pid=4&page=1&sessionId=c4faa1982c906a380e4fd09248428bd2"
headers = {
'charset': 'utf-8',
'Accept-Encoding': 'gzip',
'referer': 'https://servicewechat.com/wx2911548a18ed7d95/40/page-frame.html',
'content-type': 'application/json',
'User-Agent': 'Mozilla/5.0 (Linux; Android 7.0; FRD-AL10 Build/HUAWEIFRD-AL10; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/62.0.3202.84 Mobile Safari/537.36 MicroMessenger/6.7.3.1360(0x26070336) NetType/WIFI Language/zh_CN Process/appbrand0',
'Host': 'api.jingchengcaidian.com',
'Connection': 'Keep-Alive'
}
req = requests.get(url=url, headers=headers).json()
print json.dumps(req,ensure_ascii=False)
{"message": "列表获取成功", "code": 1, "data": [{"timelable": "", "lable": "超值特惠", "name": "烟台鲜活港湾扇贝27-39个约(0.9kg-1kg)", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-10-12/1539339177.jpg", "amount": 67, "isvideo": "0", "market_price": "15.80", "buynum": "0", "group_price": "9.90", "smallpromotion": "肉质肥美,鲜嫩", "cateid": 470, "id": 11063, "desc": "取货时间:10月26日 16:00"}, {"timelable": "", "lable": "", "name": "烟台梭子蟹约1kg5-6只", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-10-22/9491540172318.jpg", "amount": 44, "isvideo": "0", "market_price": "100.00", "buynum": 85, "group_price": "85.00", "smallpromotion": "八成肥,保鲜不保活", "cateid": 470, "id": 11103, "desc": "取货时间:10月26日 16:00"}, {"timelable": "", "lable": "", "name": "烟台鲜小黄花鱼20-24条约(0.9kg-1kg)", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-10-12/1539352456.jpg", "amount": 93, "isvideo": "0", "market_price": "36.80", "buynum": "0", "group_price": "25.80", "smallpromotion": "纯野生,味道鲜美", "cateid": 470, "id": 11065, "desc": "取货时间:10月26日 16:00"}, {"timelable": "", "lable": "", "name": "烟台鲜平鱼8-10条约(0.9kg-1kg)", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-10-12/1539334316.jpg", "amount": 127, "isvideo": "0", "market_price": "55.00", "buynum": "0", "group_price": "35.00", "smallpromotion": "未浸泡淡水,味道鲜美", "cateid": 470, "id": 11056, "desc": "取货时间:10月26日 16:00"}, {"timelable": "", "lable": "", "name": "渤海湾鲜鲅鱼2条约(0.9kg-1kg)", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-10-22/3961540171948.jpg", "amount": 139, "isvideo": "0", "market_price": "45.00", "buynum": "0", "group_price": "39.80", "smallpromotion": "未浸泡淡水,味道鲜美", "cateid": 470, "id": 11050, "desc": "取货时间:10月26日 16:00"}, {"timelable": "", "lable": "", "name": "渤海湾鲜带鱼4-5条约(0.9kg-1kg)", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-10-23/351540261202.jpg", "amount": 15, "isvideo": "0", "market_price": "55.00", "buynum": "0", "group_price": "39.80", "smallpromotion": "未浸泡淡水,味道鲜美", "cateid": 470, "id": 11055, "desc": "取货时间:10月26日 16:00"}, {"timelable": "", "lable": "", "name": "阳澄湖大闸蟹礼券588型5对10只(公3两/只 母2两/只)", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-08-22/1534921365.jpg", "amount": 17, "isvideo": "0", "market_price": "280.00", "buynum": "0", "group_price": "258.00", "smallpromotion": "个体肥大、肉满黄肥、鲜嫩多汁", "cateid": 820, "id": 10307, "desc": "取货时间:10月25日 16:00"}, {"timelable": "", "lable": "", "name": "阳澄湖大闸蟹礼券688型4对8只(公3.5两/只 母2.5两/只)", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-08-22/1534922338.jpg", "amount": 10, "isvideo": "0", "market_price": "308.00", "buynum": "0", "group_price": "288.00", "smallpromotion": "个体肥大、肉满黄肥、鲜嫩多汁", "cateid": 820, "id": 10308, "desc": "取货时间:10月25日 16:00"}, {"timelable": "", "lable": "", "name": "阳澄湖大闸蟹礼券888型5对10只(公3.5两/只 母2.5两/只)", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-08-22/331534922488.jpg", "amount": 15, "isvideo": "0", "market_price": "378.00", "buynum": "0", "group_price": "338.00", "smallpromotion": "个体肥大、肉满黄肥、鲜嫩多汁", "cateid": 820, "id": 10309, "desc": "取货时间:10月25日 16:00"}, {"timelable": "", "lable": "", "name": "阳澄湖大闸蟹礼券1088型4对8只(公4两/只 母2.8两/只)", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-08-22/1534922578.jpg", "amount": 20, "isvideo": "0", "market_price": "428.00", "buynum": "0", "group_price": "388.00", "smallpromotion": "个体肥大、肉满黄肥、鲜嫩多汁", "cateid": 820, "id": 10310, "desc": "取货时间:10月25日 16:00"}, {"timelable": "", "lable": "", "name": "阳澄湖大闸蟹礼券1368型5对10只(公4两/只 母2.8两/只)", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-08-22/1534922666.jpg", "amount": 16, "isvideo": "0", "market_price": "538.00", "buynum": "0", "group_price": "488.00", "smallpromotion": "个体肥大、肉满黄肥、鲜嫩多汁", "cateid": 820, "id": 10311, "desc": "取货时间:10月25日 16:00"}, {"timelable": "", "lable": "", "name": "阳澄湖大闸蟹礼券1388型4对8只(公4.5两/只 母3.2两/只)", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-08-22/1534922765.jpg", "amount": 18, "isvideo": "0", "market_price": "648.00", "buynum": "0", "group_price": "558.00", "smallpromotion": "个体肥大、肉满黄肥、鲜嫩多汁", "cateid": 820, "id": 10312, "desc": "取货时间:10月25日 16:00"}, {"timelable": "", "lable": "", "name": "阳澄湖大闸蟹礼券1688型5对10只(公4.5两/只 母3.2两只)", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-08-22/1534922864.jpg", "amount": 19, "isvideo": "0", "market_price": "788.00", "buynum": "0", "group_price": "688.00", "smallpromotion": "个体肥大、肉满黄肥、鲜嫩多汁", "cateid": 820, "id": 10313, "desc": "取货时间:10月25日 16:00"}, {"timelable": "", "lable": "", "name": "阳澄湖大闸蟹礼券2088型4对8只(公5两/只 母3.6两/只)", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-08-22/1534922938.jpg", "amount": 20, "isvideo": "0", "market_price": "1108.00", "buynum": "0", "group_price": "928.00", "smallpromotion": "个体肥大、肉满黄肥、鲜嫩多汁", "cateid": 820, "id": 10314, "desc": "取货时间:10月25日 16:00"}, {"timelable": "", "lable": "", "name": "阳澄湖大闸蟹礼券2588型5对10只(公5两/只 母3.6两/只)", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-08-22/1534923022.jpg", "amount": 19, "isvideo": "0", "market_price": "1308.00", "buynum": "0", "group_price": "1138.00", "smallpromotion": "个体肥大、肉满黄肥、鲜嫩多汁", "cateid": 820, "id": 10315, "desc": "取货时间:10月25日 16:00"}, {"timelable": "", "lable": "", "name": "野渔江湖-冰鲜野生小鲫鱼一斤5条左右-500克/袋", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-09-05/1536121055.jpg", "amount": 58, "isvideo": "1", "market_price": "35.00", "buynum": "0", "group_price": "25.00", "smallpromotion": "水库野生净膛冰鲜口感佳安全健康", "cateid": 824, "id": 10543, "desc": "取货时间:10月27日 16:00"}, {"timelable": "", "lable": "", "name": "野渔江湖-冰鲜水库鱼头-1000克/份", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-09-05/1536121995.jpg", "amount": 95, "isvideo": "1", "market_price": "90.00", "buynum": "0", "group_price": "70.00", "smallpromotion": "水库胖头鱼头 净膛 冰鲜送达", "cateid": 824, "id": 10544, "desc": "取货时间:10月27日 16:00"}, {"timelable": "", "lable": "", "name": "野渔江湖-水库冰鲜草鱼-1000克/份", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-09-05/1536122888.jpg", "amount": 94, "isvideo": "1", "market_price": "90.00", "buynum": "0", "group_price": "65.00", "smallpromotion": "水库野生草鱼净膛真空包装冰鲜送达", "cateid": 824, "id": 10545, "desc": "取货时间:10月27日 16:00"}, {"timelable": "", "lable": "", "name": "野渔江湖-水库野生黑鱼-500克/条", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-09-25/1537847141.jpg", "amount": 21, "isvideo": "0", "market_price": "40.00", "buynum": "0", "group_price": "35.00", "smallpromotion": "野生黑鱼肉质细嫩刺少安全美味", "cateid": 824, "id": 10767, "desc": "取货时间:10月27日 16:00"}, {"timelable": "", "lable": "", "name": "野渔江湖-水库野生小银鱼-500克/袋", "image": "http://checkmall.oss-cn-beijing.aliyuncs.com//Uploads/Picture/2018-10-07/1538885315.jpg", "amount": 25, "isvideo": "0", "market_price": "40.00", "buynum": "0", "group_price": "34.00", "smallpromotion": "新鲜银鱼无刺高蛋白老少皆宜", "cateid": 824, "id": 10841, "desc": "取货时间:10月27日 16:00"}], "page": 2}
*url中的sessionid是加密过的,这个以后在研究