delphi7 idhttp1 是否可以模拟鼠标点击某个区域我不打算用 webbrowser1 打算用idhttp1 来实现 小弟求助

解决方案 »

  1.   

    1,使用 火狐浏览器2.0在工具-页面信息-表单- 获得所有表单信息 
    2,把表单 字段名称和当前值 都写进去 procedure TForm1.Button1Click(Sender: TObject); 
    var 
    postList: TStrings; 
    Response: TStringStream; begin; 
          Response := TStringStream.Create(''); 
          postList := TStringList.Create; 
          try 
              IdHTTP1.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Maxthon)'; 
              postList.Add('__EVENTTARGET='); 
              postList.Add('__VIEWSTATE=/wEPDwUJLTI5NjAzODk2ZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQULY2hrUmVtZW1iZXKHW0DW4nQrSrBHBomKrt3/MjtBLA=='); 
              postList.Add('__EVENTVALIDATION=/wEWBQKE2u7lCQLyj/OQAgK3jsrkBALR55GJDgKC3IeGDO8x1Jd0k/hBY1a/6Yl9fTpP16ti'); 
              postList.Add('tbUserName=用户名称'); 
              postList.Add('tbPassword=用户密码'); 
              postList.Add('chkRemember='); 
              postList.Add('btnLogin=登 录'); 
              IdHTTP1.Post('http://passport.cnblogs.com/login.aspx',postList,Response); 
          finally 
              Memo1.Lines.Text := Utf8ToAnsi(Response.DataString); 
              Response.Free; 
              postList.Free; 
          end; end; 
     
    如果转向将 idhttp handleredirc设置为True 下面是获得转向地址: procedure TForm1.IdHTTP1Redirect(Sender: TObject; var dest: String; 
      var NumRedirect: Integer; var Handled: Boolean; 
      var VMethod: TIdHTTPMethod); 
    var 
    url : string; 
    begin 
        url := dest; 
        Handled:=True;  
        showmessage(url);//转向地址 
    end; 
      

  2.   

    我是想写一个 Idhttp1.post 访问网页 点击广告的 postList.Add('tbUserName=用户名称');
              postList.Add('tbPassword=用户密码');
              postList.Add('chkRemember=');
              postList.Add('btnLogin=登 录'); post的参数 写什么 没有 用户密码 登陆一类的
      

  3.   

    点击广告不需要Post 通常都是用Get的```不过现在的广告很多都写的比较猥琐,尝试抓包找出两次点击的不同之处
      

  4.   

    idhttp1 点击广告 get 可以吗??不是 post 才可以吗??