有些网页使用了div来控制层
在div里面有onmouseover事件,在里面有一些代码,当你鼠标移动到上面的时候可以执行,
在里面存放了一些数据,例如
<div class="charstats_bg" id="char_leben_tt" onMouseOver="return escape('<div id=tt1><div id=tt2 style=\'position:relative; left:2px; top:2px; width:329px; height:138px; background:#000; filter:alpha(opacity=75); -moz-opacity:0.75;opacity: 0.75;\'><div id=tt3 style=\'position:relative; left:0px; top:0px; border: 1px solid #999; width:329px; height:138px; font-family:tahoma; \'><table width=\'100%\' cellspacing=2 cellpadding=2 valign=middle><tr><td style=\'color:#BA9700; font-weight: bold; font-size:9pt\'>我要获得的信息</td></tr><tr><td style=\'color:#DDD; font-weight: bold; font-size:8pt\'>信息2</td></tr><tr><td style=\'color:#DDD; font-weight: bold; font-size:8pt\'+128</td></tr></table></div></div></div>')">
但是我用webbrowser获得不到onMouseOver里面的代码, 我想问下,要如何获得里面的代码,我好获取以后自动分析

解决方案 »

  1.   

    private void button1_Click(object sender, EventArgs e)
            {
               object o= this.webBrowser1.Document.GetElementById("char_leben_tt").InvokeMember("onMouseOver");
                //this.webBrowser1.Document.GetElementById("char_leben_tt").MouseOver += new HtmlElementEventHandler(Form1_MouseOver);
            }
      

  2.   

    我想获得里面的代码字符串onMouseOver
      比如
      <div   id=tt1> <div   id=tt2   style=\'position:relative;   left:2px;   top:2px;   width:329px;   height:138px;   background:#000;   filter:alpha(opacity=75);   -moz-opacity:0.75;opacity:   0.75;\'> <div   id=tt3   style=\'position:relative;   left:0px;   top:0px;   border:   1px   solid   #999;   width:329px;   height:138px;   font-family:tahoma;   \'> <table   width=\'100%\'   cellspacing=2   cellpadding=2   valign=middle> <tr> <td   style=\'color:#BA9700;   font-weight:   bold;   font-size:9pt\'> 我要获得的信息 </td> </tr> <tr> <td   style=\'color:#DDD;   font-weight:   bold;   font-size:8pt\'> 信息2 </td> </tr> <tr> <td   style=\'color:#DDD;   font-weight:   bold;   font-size:8pt\'+128 </td> </tr> </table> </div> </div> </div>