Tio so kanns gehen. Ansatz war ja ok, und dennoch falsch...
Habs jetzt selber hinbekommen!
Für alle die es interessieren sollte:
Input Button Click:
Code:
procedure TForm1.Button1Click(Sender: TObject);
var
ovElements: OleVariant;
i,j: Integer;
begin
for j := 0 to (WebBrowser1.OleObject.Document.forms.Length - 1) do
begin
ovElements := WebBrowser1.OleObject.Document.forms.item(j).elements;
for i := 0 to (ovElements.Length - 1) do
if ((ovElements.item(i).tagName = 'INPUT') and (ovElements.item(i).type = 'submit') and (ovElements.item(i).Value = 'Login2')) then
ovElements.item(i).Click;
end;
end;
Link Click:
Code:
procedure TForm1.Button2Click(Sender: TObject);
var i:integer;
ovLinks: OleVariant;
begin
ovLinks := Webbrowser1.OleObject.Document.links;
for i := 0 to (ovLinks.Length - 1) do
IF ovLinks.Item(i).InnerText = 'Link 4' THEN
ovLinks.Item(i).Click;
end;
MFG emploi