Moin,
zum klicken eines Links im TWebBrowser benutze ich diesen code:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17:
| procedure WB_ClickLink(WB: TWebbrowser; const LinkText: string); var HTMLDocument2: IHTMLDocument2; Element: IHTMLElement; I: Integer; begin HTMLDocument2 := WB.Document as IHTMLDocument2; for I := 0 to HTMLDocument2.Links.Length - 1 do begin Element := HTMLDocument2.Links.Item(I, 0) as IHTMLElement; if Element.GetAttribute('innerText', 0) = LinkText then begin Element.Click; Break; end; end; end; |
Weis jemand wie ich diesen code zu umschreiben kann, damit er auch auf Frameseiten funktioniert?
LG