procedure TForm6.Button1Click(Sender: TObject);
var
Form: OleVariant;
I, I2: Integer;
begin
for I := 0 to WebBrowser1.OleObject.Document.Forms.Length - 1 do
begin
Form := WebBrowser1.OleObject.Document.Forms.Item(I).elements;
for I2 := 0 to Form.Length - 1 do
begin
if Form.Item(I2).name = 'log_email' then Form.Item(I2).value := ELogin.Text
else if Form.Item(I2).name = 'pass' then Form.Item(I2).value := EPassword.Text;
Button2.Click;
end;
end;
end;
procedure TForm6.Button2Click(Sender: TObject);
var
Form: OleVariant;
I, I2: Integer;
begin
for I := 0 to WebBrowser1.OleObject.Document.Forms.Length - 1 do
begin
Form := WebBrowser1.OleObject.Document.Forms.Item(I).elements;
for I2 := 0 to Form.Length - 1 do
begin
if ((Form.Item(I2).type = 'submit') and (Form.Item(I2).value = 'Войти')) then
begin
Form.Item(I2).Click;
end;
end;
end;
end;