请教这个网站如何登陆,我总是登陆不了,用idhttp登陆,或者用webbrowser登陆获取cookie,再用idhttp去get,位登陆状态就OK webbrowser,delphicookieidhttp 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我現在是用WebBrowser,源碼:procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant);var aintf: IWebBrowser;begin aintf := WebBrowser1.Application as IWebBrowser; ComboBox1.Text:= aintf.LocationURL; WEBCooKies :=(WebBrowser1.document as ihtmldocument2).cookie; Memo1.Text:= WEBCooKies;end;procedure TForm1.Button2Click(Sender: TObject);beginIdHTTP2:=TIdHTTP.Create(nil);IdHTTP2.HandleRedirects:=true;IdHTTP2.Request.UserAgent := 'Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0';IdHttp2.Request.Host:='107.170.52.154';idhttp2.Request.ContentType:='application/x-www-form-urlencoded';idhttp2.Request.Referer:='http://107.170.52.154/home.php?mod=space&uid=2650200';idhttp2.Request.Connection:='Keep-Alive';//idhttp2.Request.AcceptEncoding:='gzip, deflate'; idhttp2.Request.Accept:='text/html, */*';IdHttp2.Request.CustomHeaders.Clear;if CheckBox1.Checked thenIdHttp2.Request.CustomHeaders.Text := 'Cookie: ' + Memo1.Text;memo2.Text:=idHttp2.Get(‘http://107.170.52.154/home.php?mod=space&uid=2650200’);IdHTTP2.Free;end;memo2.Text得到的狀態不是登陸的!請高手幫忙,,,,用idhttp post方法登陆,或者用webbrowser手动登陆都可以。。 這個是httpanalyzer登陸狀態抓取的Cookie:Cookie Name ValueAKb4_2132_auth 9ddfbFgdSqjrETXZbThw14ZGeEFEwqQ+I+Sf60bQpfsgwH4mpMjCsp2CYe82ftudm0RbVEM4+767UnAC1rz8MuhYR9OGAKb4_2132_home_diymode 1AKb4_2132_lastact 1414749673 home.php spacecpAKb4_2132_lastcheckfeed 2650223|1414748719AKb4_2132_lastvisit 1414745048AKb4_2132_myrepeat_rr R0AKb4_2132_saltkey p85RYxSwAKb4_2132_sendmail 1AKb4_2132_sid GOpUbvAKb4_2132_straightdisplay straightdisplayAKb4_2132_ulastactivity 894dWAqOFyhkgCDbeLFJA/+O05g2xxaL5hTzXcykidlJH3Qhp7/bAKb4_2132_viewid uid_2650200httpguard 505209072twc_count 0twc_lasttime 1414734677418VaDc1 MTQxNDczNDgzM3H OxA9SGGZ RN5/Q__atuvc 12|44__atuvs 54535a5250d92a81006 我把抓取的Cookie转化一下格式放入Memo1.Text;结果还是获取不到登陆状态。。求解 WebBrowser1.Navigate('http://107.170.52.154/home.php?mod=space&uid=2650200');这句就可以再浏览器控件打开网页, 没时间写代码,只能给出个提示,登陆前先要访问一次登录页面获得2个关键数据一处是post表单需要用到的字段formhash<input type="hidden" value="ad60ad90" name="formhash">一处是post到的URL<form action="member.php?mod=logging&action=login&loginsubmit=yes&loginhash=LJ3d8" onsubmit="pwmd5('password3_LJ3d8');pwdclear = 1;ajaxpost('loginform_LJ3d8', 'returnmessage_LJ3d8', 'returnmessage_LJ3d8', 'onerror');return false;" class="cl" id="loginform_LJ3d8" name="login" autocomplete="off" method="post"> 非常感謝~原來這個登陸網頁有2個參數,我之前只只看到一個參數,謝謝提醒。。登陸成功啦1.name="formhash“ 2.loginhash=LJ3d8 搞定啦!!!! CSDN高手果然多!!!! 如何更好的接收和发送串口数据(去除串口收到的#0) 感谢大家 我刚学不久,这个是什么意思呀 如何完全控制应用程序,如让记事本打开指定的文件,退出程序等。 在DELPHI中如何使用BDE直接访问Excel数据文件?请进指点。 那里有delphi安装程序下载??? 很多软件比如LeapFTP,FlashGet等都有一个proxy设置,用Delphi如何实现这个功能? 关于视图的删除? 有关TQRPreview的用法。 请问delphi4中如何用createfile函数调用smartvsd.vxd? 新手的几个粗浅问题。。。 求FASTREPORT 5 FOR XE7源码版
procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
var
aintf: IWebBrowser;
begin
aintf := WebBrowser1.Application as IWebBrowser;
ComboBox1.Text:= aintf.LocationURL;
WEBCooKies :=(WebBrowser1.document as ihtmldocument2).cookie;
Memo1.Text:= WEBCooKies;
end;procedure TForm1.Button2Click(Sender: TObject);
begin
IdHTTP2:=TIdHTTP.Create(nil);
IdHTTP2.HandleRedirects:=true;
IdHTTP2.Request.UserAgent := 'Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0';
IdHttp2.Request.Host:='107.170.52.154';
idhttp2.Request.ContentType:='application/x-www-form-urlencoded';
idhttp2.Request.Referer:='http://107.170.52.154/home.php?mod=space&uid=2650200';
idhttp2.Request.Connection:='Keep-Alive';
//idhttp2.Request.AcceptEncoding:='gzip, deflate';
idhttp2.Request.Accept:='text/html, */*';
IdHttp2.Request.CustomHeaders.Clear;
if CheckBox1.Checked then
IdHttp2.Request.CustomHeaders.Text := 'Cookie: ' + Memo1.Text;
memo2.Text:=idHttp2.Get(‘http://107.170.52.154/home.php?mod=space&uid=2650200’);
IdHTTP2.Free;end;memo2.Text得到的狀態不是登陸的!
請高手幫忙,,,,用idhttp post方法登陆,或者用webbrowser手动登陆都可以。。
Cookie Name Value
AKb4_2132_auth 9ddfbFgdSqjrETXZbThw14ZGeEFEwqQ+I+Sf60bQpfsgwH4mpMjCsp2CYe82ftudm0RbVEM4+767UnAC1rz8MuhYR9OG
AKb4_2132_home_diymode 1
AKb4_2132_lastact 1414749673 home.php spacecp
AKb4_2132_lastcheckfeed 2650223|1414748719
AKb4_2132_lastvisit 1414745048
AKb4_2132_myrepeat_rr R0
AKb4_2132_saltkey p85RYxSw
AKb4_2132_sendmail 1
AKb4_2132_sid GOpUbv
AKb4_2132_straightdisplay straightdisplay
AKb4_2132_ulastactivity 894dWAqOFyhkgCDbeLFJA/+O05g2xxaL5hTzXcykidlJH3Qhp7/b
AKb4_2132_viewid uid_2650200
httpguard 505209072
twc_count 0
twc_lasttime 1414734677418
VaDc1 MTQxNDczNDgzM3H OxA9SGGZ RN5/Q
__atuvc 12|44
__atuvs 54535a5250d92a81006
这句就可以再浏览器控件打开网页,
一处是post表单需要用到的字段formhash
<input type="hidden" value="ad60ad90" name="formhash">
一处是post到的URL
<form action="member.php?mod=logging&action=login&loginsubmit=yes&loginhash=LJ3d8" onsubmit="pwmd5('password3_LJ3d8');pwdclear = 1;ajaxpost('loginform_LJ3d8', 'returnmessage_LJ3d8', 'returnmessage_LJ3d8', 'onerror');return false;" class="cl" id="loginform_LJ3d8" name="login" autocomplete="off" method="post">
非常感謝~原來這個登陸網頁有2個參數,我之前只只看到一個參數,謝謝提醒。。登陸成功啦
1.name="formhash“ 2.loginhash=LJ3d8 搞定啦!!!! CSDN高手果然多!!!!