web_reg_save_param抓取到多个匹配值时,如何拿到你想要的那个
本帖最后由 开着拖拉机上班 于 2017-7-27 15:32 编辑终于鼓捣成功了,他娘的,保存一下:
//获取 coverageDetail_actualId
web_reg_save_param("getCoverageDetail_actualId",
"LB=coverageDetail\":[",
"RB=,",
"Ord=ALL",
"SaveOffset=27",
"IgnoreRedirections=Yes",
LAST);
web_custom_request
count=atoi(lr_eval_string("{getCoverageDetail_actualId_count}"));
lr_error_message("抓取到的getCoverageDetail_actualId数量:%d",count);
for(i=1;i<=count;i++){
sprintf(param,"{getCoverageDetail_actualId_%d}",i);
lr_error_message(param);
}
//检查下抓到的值是否是你想要的!!!
lr_error_message(lr_eval_string(param));
lr_error_message(lr_eval_string(param));
lr_error_message(lr_eval_string(param));
lr_error_message(lr_eval_string(param));
lr_error_message(lr_eval_string(param));
lr_error_message(lr_eval_string(param));
下面是输出:
Error567Action.c(567): Error: 抓取到的getCoverageDetail_actualId数量:6Action.c
Error570Action.c(570): Error: {getCoverageDetail_actualId_1}Action.c
Error570Action.c(570): Error: {getCoverageDetail_actualId_2}Action.c
Error570Action.c(570): Error: {getCoverageDetail_actualId_3}Action.c
Error570Action.c(570): Error: {getCoverageDetail_actualId_4}Action.c
Error570Action.c(570): Error: {getCoverageDetail_actualId_5}Action.c
Error570Action.c(570): Error: {getCoverageDetail_actualId_6}Action.c
Error573Action.c(573): Error: 180516488Action.c
Error574Action.c(574): Error: 180516493Action.c
Error575Action.c(575): Error: 180516998Action.c
Error576Action.c(576): Error: 180517003Action.c
Error577Action.c(577): Error: 180517008Action.c
Error578Action.c(578): Error: 180517013Action.c
int i;
intcount;
char param;
变量的定义一定要放在脚本的最前面,否则报错。
页:
[1]