本帖最后由 whb1573 于 2009-08-24 14:08:44 编辑

解决方案 »

  1.   

    看你也是提问WebBrowser问题,请问你用WebBrowser到时候有没有遇到过报错啊,invalid floating point operation。
      

  2.   


    uses mshtml;procedure TForm1.Button1Click(Sender: TObject);
    var
      doc: IHTMLDocument2;
    begin
      doc := webbrowser1.document as IHTMLDocument2;
      ShowMessage( doc.body.getAttribute('background', 0));
    end;适合下面这样的:<BODY BGCOLOR=#FFFFFF leftmargin=0 rightmargin=0 marginwidth=0 marginheight=0 topmargin=0 background=img/bg2.gif >取到的值为:"img/bg2.gif "
      

  3.   

    to 1#:没遇到这种情况,你可以单步调试看看是哪出错。
    to 2#:网页中没有这种格式,完全是动态调用,js生成背景图片。
    to 3#:有什么方法吗?或者有遍历页面图片的方法也可以。我用了遍历img元素,获取不到,有没有其它方法呢?
      

  4.   

    doc.body.getAttribute
    doc.body.Style
    试试这几个吧
    JS的也没试过
      

  5.   

    其实就是获取cn.bing.com的背景图片,有没有方法?
      

  6.   


    WebBrowser1.Navigate('http://cn.bing.com/');
    .............................
    WebBrowser1.OleObject.document.getElementById('bgDiv').style.BackGroundImage;
      

  7.   

    你看一下你的这个帖子~~http://topic.csdn.net/u/20090826/16/451b9db8-3c12-4862-9f0f-0a32ec254dc1.html?21262
      

  8.   

    取到取不到你自己不会试吗,在浏览器里面只有dom,不管你是js还是什么