窗口上放一个TWebBrowser控件 命名为Browser。在uses节加入MSHTML引用放一个TButton,单击事件里写var Doc:IHTMLDocument2; PasswordObj:IHTMLObjectElement; V:OleVariant;begin Browser.Navigate('https://www.alipay.com/user/login.htm'); while Browser.ReadyState<>4 do Application.ProcessMessages; Doc:=Browser.Document as IHTMLDocument2; (Doc.all.item('_fmu.l._0.e',varEmpty) as IHTMLInputElement).value:='帐户'; PasswordObj:=Doc.all.item('Password_Edit',varEmpty) as IHTMLObjectElement; V:=PasswordObj.object_; v.PasswordMode:=True; v.SecurityMode:=False; V.TextData:='密码'; (Doc.all.item('Submit',varEmpty) as IHTMLElement).Click; //点击登录按钮end;