本帖最后由 medical52001 于 2010-02-19 21:37:59 编辑

解决方案 »

  1.   

    可以,不过比较麻烦,要分析元素还有属性,然后程序里自己做click事件
      

  2.   

    用抓包工具抓一下当提交用户名和密码时的信息,分析下提交的参数,然后利用idhttp即可完成
      

  3.   

    delphi盒子中有一个开心网外挂的源代码,楼主有兴趣可以去看看
      

  4.   

    利用webbrowser可以。
    var
      doc:ihtmldocument2;
      input:olevariant;
      user,pwd,pp:ihtmlinputelement;
    begin
      try
        doc := webbrowser1.document as ihtmldocument2;
        user := (doc.all.item('username',0) as ihtmlinputelement);
        user.value := '';//取值给网页的用户名文本框
        pwd := (doc.all.item('password',0) as ihtmlinputelement);
        pwd.value := '';//取值给网页的密码文本框
        input := doc.all.item('submit',0);
        input.click;
      except  end
    end;
    不过这样感觉速度慢。
      

  5.   

    可以用TIdHttp实现。相关属性和事件:
    TIdHttp.Request.Username
    TIdHttp.Request.Password
    TIdHttp.Request.BasicAuthentication
    TIdHttp.OnSelectAuthorization
    TIdHttp.OnAuthorization如果网站采用Basic认证(最常见的情况),那么直接把TIdHttp.Request.BasicAuthentication改为True,并在TIdHttp.Post/TIdHttp.Get之前设置TIdHttp.Request.Username和TIdHttp.Request.Password即可。如果网站采用其他方式认证,则必须在TIdHttp.SelectAuthorization事件中指定对应的认证对象的类型,并在OnAuthorization事件中提供用户名和密码。
      

  6.   

    上面说的是网站内容有密码验证保护的情况,也就是输入网址就跳出窗口要求输入用户名和密码的那种。至于类似淘宝登录的那中,其实在HTML里面就是个<form method="" action="">。method是Form用什么方式提交(GET还是POST),action里面是这个Form在按下提交按钮后被提交到的网址。例如:
    <form method="POST" action="login.asp">
    <input type="edit" name="username">
    <input type="edit" name="password">
    ……
    </form>如果method是POST,那么你就需要用TIdHttp.Post方法,如果是GET,就用TIdHttp.Get方法。提交时浏览器生成的目标网址为:http://xxx.xxx.xxx/login.asp?username=xxx&password=xxx你只需要用程序组合出正确的URL,用正确的TIdHttp方法,就可以实现自动登录了。当然,需要检查TIdHttp.Get和TIdHttp.Post方法执行后TIdHttp.Response对象,因为很多网站是利用Cookie来保持登录状态的。可以遍历TIdHttp.Response.RawHeaders,看看有没有一行是"Set-Cookie: xxxxx",如果有,就把xxxx保存下来,以后每次提交其他内容时,加上以下几行:TIdHttp.Request.CustomHeaders.Clear;
    TIdHttp.Request.CustomHeaders.Append("Cookie: " + "xxxxxx");还有不明白的随时提问哦。我最近正好也在做这些东西。
      

  7.   

    [email protected]。能发给我吗?谢谢
      

  8.   

    procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
      const pDisp: IDispatch; var URL: OleVariant);
      var
      o:OleVariant;
    begin
          o := WebBrowser1.OleObject.document.all.item('UserName',0);
          o.value:=edit1.text;
          o := WebBrowser1.OleObject.document.all.item('Password',0);
          o.value:=edit2.text;
          o := WebBrowser1.OleObject.document.all.item('Logon',0);
          o.click;
    end;
    你要查看源文件知道输入用户名,密码和登陆按钮的名称
      

  9.   


    WebBrowser1.Navigate('http://www.baidu.com');
      

  10.   

    网页中诸多个<input>,获得input的name属性值,然后做相应的操作,比如获得input name等于"pwd"的,然后让该input的value值为“123”,
      

  11.   

    http://download.csdn.net/source/2650664
      

  12.   

    有name和id的不难,难的是没有任何标记的……
      

  13.   

    自动登录可以用webbrowser实现
    查看网站的源码,找到用户名和密码的input,用webbrowser中的方法给input赋值,然后模拟点击登录按钮
    不过淘宝的登录用户名和密码框不是简单的网页元素input,貌似是ocx实现的,不知道用webbrowser怎么实现这样的