普通的我知道怎么点,但是这种特殊的JAVA超链接怎么点?<a href="javascript:void(0)" class="toggleLoginPwd">点击</a>

解决方案 »

  1.   

    试试uses  
      mshtml, ActiveX;   var  
    I: Integer;
    Document: IHTMLDocument2;
    Element: IHTMLElement;
    Anchors: IHTMLElementCollection;
    sLink: string;
    begin
       //查找链接
       sLink := 'javascript:void(0)';
       Document := Webbrowser1.Document as IHTMLDocument2;
       if Assigned(Document) then
       begin
          Anchors := Document.Get_links;
          //遍历所有链接
          for i := 0 to Anchors.length - 1 do
          begin
             Element := Anchors.item(i, varempty) as IHTMLElement;
             //找到指定链接
             if Assigned(Element) and (UpperCase((Element as IHTMLAnchorElement).href) = UpperCase(sLink)) then
            begin
               //执行点击
               Element.Click;
               Break;
            end;
          end;
       end;
    end;
      

  2.   

    Webbrowser1.Navigate('javascript:void(0)')