?第一篇我们介绍了如何通过LR来捕获手机发出的真实访问数据,这一篇我们将介绍捕获数据之后的操作。
?
? 接第一篇:
?1. 用wireshark 捕获手机访问的数据后,可以根据协议来筛选仅HTML或者不筛选让LR自己分析。选择另存将wireshark 获取的数据包保存为.pcap格式。
?2. 打开LR11.5(至少是以上版本才支持此协议)。选择 mobile http/html协议。
?
2.选择录制
?3.选择导出的.pcap文件,并选择第二项,通过分析数据以生成脚本,其它用默认即可。
?4.导入后我们来看一下生成的脚本代码
Action()
{
web_add_cookie("QN48=tc_f39fc2c153a007a1_13c29f5c48b_90e7; DOMAIN=touch.qunar.com");
web_add_cookie("QN1=wKgZEVDwHiZ0pjsMBcTaAg==; DOMAIN=touch.qunar.com");
web_add_cookie("QN48=tc_f39fc2c153a007a1_13c29f5c48b_90e7; DOMAIN=bc.qunar.com");
web_add_cookie("QN1=wKgZEVDwHiZ0pjsMBcTaAg==; DOMAIN=bc.qunar.com");
web_url("touch.qunar.com",
"URL=http://touch.qunar.com/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=http://bc.qunar.com/wap?utmwv=0.1&t=0.7578790553379804&utmsr=720*1280&utmr=-1&utmp=http%3A%2F%2Ftouch.qunar.com%2F&utmhn=touch.qunar.com&s=266&a=tw_index", ENDITEM,
LAST);
web_link("SelectFlight",
"Text=SelectFlight",
"Snapshot=t2.inf",
EXTRARES,
"Url=http://bc.qunar.com/wap?utmwv=0.1&t=0.4847093583084643&utmsr=720*1280&utmr=http%3A%2F%2Ftouch.qunar.com%2F&utmp=http%3A%2F%2Ftouch.qunar.com%2Fflight.jsp%3Fbd_source%3Dqunar%26backUrl%3D%252F&utmhn=touch.qunar.com&s=254&a=tw_flightIndex", "Referer=http://touch.qunar.com/flight.jsp?bd_source=qunar&backUrl=%2F", ENDITEM,
"Url=/filghtCitySuggest.jsp?city=%25E4%25B8%258A%25E6%25B5%25B7&_=1357913752957", "Referer=http://touch.qunar.com/flight.jsp?bd_source=qunar&backUrl=%2F", ENDITEM,
"Url=/filghtCitySuggest.jsp?city=%25E6%25AD%25A6%25E6%25B1%2589&_=1357913758311", "Referer=http://touch.qunar.com/flight.jsp?bd_source=qunar&backUrl=%2F", ENDITEM,
LAST);
web_add_cookie("QN48=tc_f39fc2c153a007a1_13c29f5c48b_90e7; DOMAIN=source.qunar.com");
web_add_cookie("QN1=wKgZEVDwHiZ0pjsMBcTaAg==; DOMAIN=source.qunar.com");
web_url("flightList.jsp",
"URL=http://touch.qunar.com/flightList.jsp?startDate=2013-01-13&backDate=2013-01-16&flightType=oneWay&bd_source=qunar&backUrl=%2Fflight.jsp%3FbackUrl%3D%252F%26bd_source%3Dqunar&startCity=%e6%88%90%e9%83%bd&destCity=%E6%AD%A6%E6%B1%89",
"Resource=0",
"RecContentType=text/html",
"Referer=http://touch.qunar.com/flight.jsp?bd_source=qunar&backUrl=%2F",
"Snapshot=t3.inf",
"Mode=HTML",
EXTRARES,
"Url=http://bc.qunar.com/wap?utmwv=0.1&t=0.8687613171059638&utmsr=720*1280&utmr=http%3A%2F%2Ftouch.qunar.com%2Fflight.jsp%3Fbd_source%3Dqunar%26backUrl%3D%252F&utmp=http%3A%2F%2Ftouch.qunar.com%2FflightList.jsp%3FstartDate%3D2013-01-13%26backDate%3D2013-01-16%26flightType%3DoneWay%26bd_source%3Dqunar%26backUrl%3D%252Fflight.jsp%253FbackUrl%253D%25252F%2526bd_source%253Dqunar%26startCity%3D%25E4%25B8%258A%25E6%25B5%25B7%26destCity%3D%25E6%25AD%25A6%25E6%25B1%2589&utmhn=touch.qunar.com&s=255&a="
"tw_flightList", "Referer=http://touch.qunar.com/flightList.jsp?startDate=2013-01-13&backDate=2013-01-16&flightType=oneWay&bd_source=qunar&backUrl=%2Fflight.jsp%3FbackUrl%3D%252F%26bd_source%3Dqunar&startCity=%e6%88%90%e9%83%bd&destCity=%E6%AD%A6%E6%B1%89", ENDITEM,
"Url=http://source.qunar.com/site/images/wap/touch/images/sp.v.png", "Referer=http://touch.qunar.com/flightList.jsp?startDate=2013-01-13&backDate=2013-01-16&flightType=oneWay&bd_source=qunar&backUrl=%2Fflight.jsp%3FbackUrl%3D%252F%26bd_source%3Dqunar&startCity=%E4%B8%8A%E6%B5%B7&destCity=%E6%AD%A6%E6%B1%89", ENDITEM,
"Url=http://source.qunar.com/site/images/wap/touch/images/icon.r.png", "Referer=http://touch.qunar.com/flightList.jsp?startDate=2013-01-13&backDate=2013-01-16&flightType=oneWay&bd_source=qunar&backUrl=%2Fflight.jsp%3FbackUrl%3D%252F%26bd_source%3Dqunar&startCity=%E4%B8%8A%E6%B5%B7&destCity=%E6%AD%A6%E6%B1%89", ENDITEM,
"Url=http://source.qunar.com/site/images/wap/touch/images/icon.top.png", "Referer=http://touch.qunar.com/flightList.jsp?startDate=2013-01-13&backDate=2013-01-16&flightType=oneWay&bd_source=qunar&backUrl=%2Fflight.jsp%3FbackUrl%3D%252F%26bd_source%3Dqunar&startCity=%E4%B8%8A%E6%B5%B7&destCity=%E6%AD%A6%E6%B1%89", ENDITEM,
"Url=http://source.qunar.com/site/images/wap/touch/images/icon.asc.png", "Referer=http://touch.qunar.com/flightList.jsp?startDate=2013-01-13&backDate=2013-01-16&flightType=oneWay&bd_source=qunar&backUrl=%2Fflight.jsp%3FbackUrl%3D%252F%26bd_source%3Dqunar&startCity=%E4%B8%8A%E6%B5%B7&destCity=%E6%AD%A6%E6%B1%89", ENDITEM,
LAST);
return 0;
}
?5.通过以上我们可以看出生成的脚本是基于手机版的,去哪网的数据。
?