Action() { int array_len ,i=1; char array_name[20]; |
//通過關(guān)聯(lián)找出所有的省市的連接地址
web_reg_save_param("outFlightVal", "LB=\"http:\/\/a.lietou.com\/", "RB=.shtml\">", "ORD=ALL", LAST); web_url("a.lietou.com", "URL=http://a.lietou.com", "Resource=0", "RecContentType=text/html", "Referer=", "Snapshot=t25.inf", "Mode=HTML", EXTRARES, LAST); |
//計算獲取省市的個數(shù),為下面的循環(huán)訪問做準(zhǔn)備
array_len=atoi(lr_eval_string("{outFlightVal_count}")); lr_output_message("%d",array_len); for (i=1;i<=array_len;i++) { |
//拼接省市請求url
sprintf(array_name,"{outFlightVal_%d}",i); lr_output_message("%s",lr_eval_string(array_name)); lr_save_string(lr_eval_string(array_name),"shen"); |
//關(guān)聯(lián)獲取title字段內(nèi)容
web_reg_save_param("title", "LB=<title>", "RB=</title>", "ORD=1", LAST); |
//關(guān)聯(lián)獲取content字段內(nèi)容
web_reg_save_param("content", "LB=content=", "RB=\/>\r\n", "ORD=1", LAST); web_url("a.lietou.com", "URL=http://a.lietou.com/{shen}.shtml", "Resource=0", "RecContentType=text/html", "Referer=", "Snapshot=t25.inf", "Mode=HTML", EXTRARES, LAST); } return 0; } |