Delphi7如何判断getElementByID()返回值?

日期:2013-03-17 21:58:31 人气:1

Delphi7如何判断getElementByID()返回值?

假如网页中有一个按钮 在delphi中引用MSHTML_TLB单元,测试代码如下 procedure TForm1.Button1Click(Sender: TObject); var b:IHTMLElement; begin b:=(WebBrowser1.Document as IHTMLDocument3).getElementById('B3'); if b=nil then exit;//这里判断网页中是不是找到了这个按钮,如果换成B4就不
    A+
热门评论