谁有IHTMLDocument2接口的定义?
 如何用程序获取网页源码?

解决方案 »

  1.   

    delphi中是否有和vb的Inet相同的控件
      

  2.   

    我用ASP倒是实现过,典型的就是新闻小偷
    DELPHI怎么用不知
    UP
      

  3.   

    我以前做的取 5460 网页上的联接代码:你可参考下!!!有问题留言!!!procedure TfrmAutoLink.GetUrl;
    var
      Document: IHtmlDocument2;
      Link: IHTMLElement;  StrLinks: string;
      i: integer;
    begin
      Document := WebBrowser1.Document as IHTMlDocument2;
      if myLst.Count > 0 then myLst.Clear;
      for i := 0 to Document.Links.Length - 1 do
      begin
        Link := Document.Links.Item(i, 0) as IHTMLElement;
        StrLinks := Link.toString;
        if Pos('http://www.5460.net/txl/liuyan/liuyanSql.pl', StrLinks) > 0
          then
        begin
          urlLiao := StrLinks;
          myLst.Add(urlLiao);
          edit1.Text := urlLiao;
          isFind := True;
          // Application.ProcessMessages;
          // WebBrowser1.Navigate(edit1.Text);
          // Memo1.Lines.Add('success at ' + DateTimeToStr(now));
           //Exit;
        end;
      end;
      try
      for I := 0 to myLst.Count - 1 do
      begin
        WebBrowser1.Navigate(myLst.Strings[I]);
        AddMsg('link to ' + myLst.Strings[I]);
        Delay(5000);
      end;
      except
        On e:Exception do AddMsg(E.Message);
      end;
    end;
      

  4.   

    IHtmlDocument2在 MsHtml.pas 中
    网页源码:
    IHtmlDocument2(WebBrowser1.Document).Body.OuterHtml
      

  5.   

    你想要, 在 source\internet\mshtml.pas 中, 
    // *********************************************************************//
    // Interface: IHTMLDocument2
    // Flags:     (4416) Dual OleAutomation Dispatchable
    // GUID:      {332C4425-26CB-11D0-B483-00C04FD90119}
    // *********************************************************************//
      IHTMLDocument2 = interface(IHTMLDocument)
        ['{332C4425-26CB-11D0-B483-00C04FD90119}']
        function  Get_all: IHTMLElementCollection; safecall;
        function  Get_body: IHTMLElement; safecall;
        function  Get_activeElement: IHTMLElement; safecall;
        function  Get_images: IHTMLElementCollection; safecall;
        function  Get_applets: IHTMLElementCollection; safecall;
        function  Get_links: IHTMLElementCollection; safecall;
        function  Get_forms: IHTMLElementCollection; safecall;
        function  Get_anchors: IHTMLElementCollection; safecall;
        procedure Set_title(const p: WideString); safecall;
        function  Get_title: WideString; safecall;
        function  Get_scripts: IHTMLElementCollection; safecall;
        procedure Set_designMode(const p: WideString); safecall;
        function  Get_designMode: WideString; safecall;
        function  Get_selection: IHTMLSelectionObject; safecall;
        function  Get_readyState: WideString; safecall;
        function  Get_frames: IHTMLFramesCollection2; safecall;
        function  Get_embeds: IHTMLElementCollection; safecall;
        function  Get_plugins: IHTMLElementCollection; safecall;
        procedure Set_alinkColor(p: OleVariant); safecall;
        function  Get_alinkColor: OleVariant; safecall;
        procedure Set_bgColor(p: OleVariant); safecall;
        function  Get_bgColor: OleVariant; safecall;
        procedure Set_fgColor(p: OleVariant); safecall;
        function  Get_fgColor: OleVariant; safecall;
        procedure Set_linkColor(p: OleVariant); safecall;
        function  Get_linkColor: OleVariant; safecall;
        procedure Set_vlinkColor(p: OleVariant); safecall;
        function  Get_vlinkColor: OleVariant; safecall;
        function  Get_referrer: WideString; safecall;
        function  Get_location: IHTMLLocation; safecall;
        function  Get_lastModified: WideString; safecall;
        procedure Set_url(const p: WideString); safecall;
        function  Get_url: WideString; safecall;
        procedure Set_domain(const p: WideString); safecall;
        function  Get_domain: WideString; safecall;
        procedure Set_cookie(const p: WideString); safecall;
        function  Get_cookie: WideString; safecall;
        procedure Set_expando(p: WordBool); safecall;
        function  Get_expando: WordBool; safecall;
        procedure Set_charset(const p: WideString); safecall;
        function  Get_charset: WideString; safecall;
        procedure Set_defaultCharset(const p: WideString); safecall;
        function  Get_defaultCharset: WideString; safecall;
        function  Get_mimeType: WideString; safecall;
        function  Get_fileSize: WideString; safecall;
        function  Get_fileCreatedDate: WideString; safecall;
        function  Get_fileModifiedDate: WideString; safecall;
        function  Get_fileUpdatedDate: WideString; safecall;
        function  Get_security: WideString; safecall;
        function  Get_protocol: WideString; safecall;
        function  Get_nameProp: WideString; safecall;
        procedure write(psarray: PSafeArray); safecall;
        procedure writeln(psarray: PSafeArray); safecall;
        function  open(const url: WideString; name: OleVariant; features: OleVariant; 
                       replace: OleVariant): IDispatch; safecall;
        procedure close; safecall;
        procedure clear; safecall;
      

  6.   

    DongXF(孔雀东南飞) 
    怎么看不到源吗?
    没有:(
      

  7.   

    Alanwn(天痴) 
    是用程序,要用源码
      

  8.   

    Re: 
      DongXF(孔雀东南飞)  
      怎么看不到源吗?
      没有:(
    WebBrowser1.Navagate('http://www.szonline.net');
    Memo1.lines.add(IHtmlDocument2(WebBrowser1.Document).Body.OuterHtml);