by Chaitanya Bhatt
Fun Script: A simple single level Web Crawler using LoadRunner
Author: Chaitanya M Bhatt
//Try it out!
/*Change the URL in seeder function to the desired parent URL from where you wish to start crawling.*/
char newlinkup[100];
int i;
web_reg_save_param("newlink", "LB=href="", "RB="", "ORD=All", LAST);
web_reg_find("Text=href=", "SaveCount=xCount", LAST);
web_url("Seeder Function",
"URL=http://www.google.com/",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
for(i=2; atoi(lr_eval_string("{xCount}")); i++)
{
sprintf(newlinkup, "{newlink_%d}", i);
lr_save_string(lr_eval_string(newlinkup), "newlinkstring");
web_url("Crawler Function" target="_blank">",
"URL={newlinkstring}",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
}
