|
我在对CSDN网站进行录制一个简单的代码的,首先就是打开CSDN网站,然后登录。因为登录的时候要输入一个校验码。所以我就对校验码做了一个关联,但老是出错。校验码的机制不是随机图片,而是随机刻画字符在图片上。
代码如下:
Action()
{
web_add_cookie("ALLYESID4=00050920132447887237773; DOMAIN=universalmccannafa.allyes.com");
web_set_max_html_param_len("1024");
/* Registering parameter(s) from source task id 5
// {Siebel_Analytic_ViewState2} = "dDwtMTcwMzgxNjQ2Mjs7bDxDU0ROVXNlckxvZ2luOmNiX1NhdmVTdGF0ZTtDU0ROVXNlckxvZ2luOkltYWdlX0xvZ2luOz4+uQcNEfb+kU5N32pqcMdrZ9WDxWc="
// */
web_reg_save_param("Siebel_Analytic_ViewState2",
"LB/IC=ViewState\" value=\"",
"RB/IC=\"",
"Ord=1",
"Search=Body",
"RelFrameId=1",
LAST);
web_url("UserLogin.aspx",
"URL=http://passport.csdn.net/member/UserLogin.aspx",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=http://www.csdn.net/ad/microsoft/07/csdeveloper/mrs05011_zoom_468x60.swf", "Referer=", ENDITEM,
"Url=http://universalmccannafa.allyes.com/main/adfshow?local=blank.swf", "Referer=", ENDITEM,
"Url=../Member/bg.jpg", ENDITEM,
LAST);
web_url("pageview1.asp",
"URL=http://count.csdn.net/count/pageview1.asp?columnid=1&itemid=3",
"Resource=0",
"RecContentType=text/html",
"Referer=http://passport.csdn.net/member/UserLogin.aspx",
"Mode=HTML",
LAST);
web_url("ShowExPwd.aspx",
"URL=http://passport.csdn.net/member/ShowExPwd.aspx",
"Resource=0",
"RecContentType=text/html",
"Referer=http://passport.csdn.net/member/UserLogin.aspx",
"Snapshot=t2.inf",
"Mode=HTML",
LAST);
web_url("hexun.aspx",
"URL=http://www.airticket.com.cn/JumpLink/hexun.aspx?25632",
"Resource=0",
"RecContentType=text/html",
"Referer=http://passport.csdn.net/member/UserLogin.aspx",
"Snapshot=t3.inf",
"Mode=HTML",
LAST);
web_url("LoginPageSideColumns.aspx",
"URL=http://www.csdn.net/LoginPageSideColumns.aspx",
"Resource=0",
"RecContentType=text/html",
"Referer=http://passport.csdn.net/member/UserLogin.aspx",
"Snapshot=t4.inf",
"Mode=HTML",
EXTRARES,
"Url=http://images.csdn.net/20050830/100X35%E6%8B%9B%E8%81%98%E6%95%99%E5%B8%8805082601.GIF", ENDITEM,
LAST);
/*显示页面*/
web_reg_save_param("tb_ExPwd","LB=&CSDNUserLogin%3Atb_ExPwd=","RB=&from","Search=ALL",LAST);
// lr_output_message("校验码是("{tb_ExPwd}")");
web_submit_data("UserLogin.aspx_2",
"Action=http://passport.csdn.net/member/UserLogin.aspx",
"Method=POST",
"RecContentType=text/html",
"Referer=http://passport.csdn.net/member/UserLogin.aspx",
"Snapshot=t5.inf",
"Mode=HTML",
ITEMDATA,
"Name=__EVENTTARGET", "Value=", ENDITEM,
"Name=__EVENTARGUMENT", "Value=", ENDITEM,
"Name=__VIEWSTATE", "Value={Siebel_Analytic_ViewState2}", ENDITEM,
"Name=CSDNUserLogin:tb_UserName", "Value=zhujiaqin", ENDITEM,
"Name=CSDNUserLogin:tb_Password", "Value=21917", ENDITEM,
"Name=CSDNUserLogin:tb_ExPwd", "Value=3151", ENDITEM,
"Name=from", "Value=", ENDITEM,
"Name=CSDNUserLogin:Image_Login.x", "Value=39", ENDITEM,
"Name=CSDNUserLogin:Image_Login.y", "Value=12", ENDITEM,
LAST);
web_url("pageview1.asp_2",
"URL=http://count.csdn.net/count/pageview1.asp?columnid=1&itemid=3",
"Resource=0",
"RecContentType=text/html",
"Referer=http://passport.csdn.net/member/UserLogin.aspx",
"Mode=HTML",
LAST);
web_url("hexun.aspx_2",
"URL=http://www.airticket.com.cn/JumpLink/hexun.aspx?25632",
"Resource=0",
"RecContentType=text/html",
"Referer=http://passport.csdn.net/member/UserLogin.aspx",
"Snapshot=t6.inf",
"Mode=HTML",
LAST);
/*登录成功*/
web_url("LoginPageSideColumns.aspx_2",
"URL=http://www.csdn.net/LoginPageSideColumns.aspx",
"Resource=0",
"RecContentType=text/html",
"Referer=http://passport.csdn.net/member/UserLogin.aspx",
"Snapshot=t7.inf",
"Mode=HTML",
LAST);
return 0;
}
我听好多人说这样的是获取不到关联的,求教于高手解决这个问题,急切盼望之中。 |
|