比如说我想读取某个页面如http://www.abcxxxx.com/cgi-bin/xxxx.cgi的数据来做处理,我该如何做?
本人没有接触过这方面的东西,请说详细点,多谢!

解决方案 »

  1.   

    2种方法:1.
    memo1.lines.add(idhttp1.get('http://www.abcxxxx.com/cgi-bin/xxxx.cgi'));2.
    interface uses mshtml;some procedure;
     var html:IHTMLDocument;
    begin
     html:=webbrowser1.document as IHTMLDocument;
     memo1.text:=doc.body.innerhtml;
    end;
      

  2.   

    自动填写IE的网页的输入框的内容    
        
    procedure TForm1.PutData;varShellWindow: IShellWindows;nCount: integer;spDisp: IDispatch;i,j,X: integer;vi: OleVariant;IE1: IWebBrowser2;IDoc1: IHTMLDocument2;iELC : IHTMLElementCollection ;S,S2 : string;HtmlInputEle : IHTMLInputElement;HtmlSelEle : IHTMLSelectElement;beginShellWindow := CoShellWindows.Create;nCount := ShellWindow.Count;for i := 0 to nCount - 1 dobeginvi := i;spDisp := ShellWindow.Item(vi);if spDisp = nil then continue;spDisp.QueryInterface( iWebBrowser2, IE1 );if IE1 <> nil thenbeginIE1.Document.QueryInterface(IHTMLDocument2,iDoc1);if iDoc1 <> nil thenbeginielc:=idoc1.Get_all;for j:=0 to ielc.length-1 dobeginApplication.ProcessMessages;spDisp := ielc.item(J, 0);if SUCCEEDED(spDisp.QueryInterface(IHTMLInputElement ,HtmlInputEle))thenwith HtmlInputEle dobeginS2:=Type_;S2:=UpperCase(S2);//我把所有的input都填上 try , checkbox 都打勾if (StrComp(PChar(S2),'TEXT')=0) or (StrComp(PChar(S2),'PASSWORD')=0) thenvalue :='try' //S:=S+#9+Valueelse if StrComp(PChar(S2),'CHECKBOX')=0 thenbeginchecked := True;end;end;if SUCCEEDED(spDisp.QueryInterface(IHTMLselectelement ,HtmlSelEle))thenwith HtmlSelEle, Memo1.Lines dobeginS:=S+#9+IntToStr(selectedIndex+1); //这个是获取数据了end;end; //END FORMemo2.Lines.Add(S);exit;end;end;end;end; 
     
     
      

  3.   

    直接下载html源码...然后通过字符分析,
    这样会快很多。
    当然啦...我们只下字符嘛...
      

  4.   

    procedure TForm1.Button2Click(Sender: TObject);
    var
    len,i:integer;
        item:oleVariant;
        innertext,href:string;
        doc:IHTMLDocument2;
        link:IHTMLElementCollection;
    begin
     //read html source
     doc:=webbrowser1.document as IHTMLDocument2;
     link:=doc.get_links;
     len:=link.length;
     for i:=0 to len-1 do
      begin
      item:=link.item(i,varempty);
      innertext:=item.innertext;
      href:=item.href;
      //innertext是超级连接的显示部分
      //href是超级连接的连接
      end;
    end;