web_find --- search for text strings in html page
The Action ()
{
web_custom_request ( "baidu_request",
"the URL = HTTP: //www.guanggoo.com/t/48529#reply3",
"= the GET Method,",
"the TargetFrame =",
"the Resource = 0",
"the Referer = ",
" Body = ",
LAST);
web_find (" web_find ",
// expected to return a successful result is to find a string, because the current page that contains the string you want to find, so the result is success
" found the expect = ",
/ / current page in the search string "sayno"
"= sayno the What",
LAST);
web_find ( "web_find",
// expected to return a successful result is to find a string, because the current page that contains the string you want to find, it returns the result success is
"the Expect = found",
// the current page in the search string "sayyes"
"= sayyes the What",
LAST);
return 0;
}
operation result:
Action.c(12): "web_find" successful. 2 occurrence(s) of "sayno" found (RightOf="", LeftOf="") [MsgId: MMSG-27196]
Action.c(12): web_find was successful [MsgId: MMSG-26392]
Action.c(19): web_find started [MsgId: MMSG-26355]
Action.c(19): Error -27195: "web_find" failed. 0 occurrence(s) of "sayyes" found (RightOf="", LeftOf="") [MsgId: MERR-27195]
Action.c(19): web_find highest severity level was "ERROR" [MsgId: MMSG-26391]
--- web_reg_find registration function, search for a text string in the following request
web_reg_find ( "Body Search =" // definition of the Look
"SaveCount = ddd", // Find the definition count variable name
LAST);
Web_castom_request ();
web_image ();
2, using techniques
there is a "SaveCount" parameter of the function, the parameters can record the number of lookups content that appears in the cache, we can use this value to determine whether or not what you're looking to be found, following give :( cited an example to illustrate examples to help in LR)
web_url("MercuryWebTours",
"URL=http://localhost/MercuryWebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
web_reg_find("Text=Welcome",
"SaveCount=Welcome_Count",
LAST);
web_submit_form("login.pl",
"Snapshot=t2.inf",
"Name=login.x", "Value=35", ENDITEM,
IF (atoi (lr_eval_string ( "Welcome_Count {}"))> 0) {// if the number is determined Welcome string appears greater than 0
lr_output_message ( "Log ON successful.");} // log output Log on successful
}
I think this is useful, we can learn by analogy, applied to our actual projects
2, the cursor To insert a function of position in the INSERT menu, select the new step, select or lookup function to be inserted in the list, follow the prompts to fill in the necessary parameters
1, these two functions different function types, WEB_FIND is a normal function, WEB_REG_FIND are registered function