在WebBrowser1DocumentComplete中:(或者你自己的按钮事件中)
procedure TPostForm.WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
var
i:integer;
t:OleVariant;
begin
t := WebBrowser1.Document;
for i := 0 to t.all.length - 1 do
begin
if t.all.item(i).tagName = 'INPUT' then
begin
if t.all.item(i).type = 'submit' then
begin
t.all.item(i).click;
exit;
end;
end;
end;
end;