如何用DELPHI执行网页表单的按妞呢?在线等! 比如按妞名字为SUBMIT,如何使用DELPHI让他点击呢?谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 varo : Olevariant;o := WebBrowser1.OleObject.document.all.item('User_Id',0); //找到登录用户名的输入框//o.value := '0096';o.value :=id;o := WebBrowser1.oleobject.document.all.item('password',0); //找到登录密码的输入框//o.value := '0096';o.value :=password;//WebBrowser1.oleobject.document.Forms.Item('btn_Sure', 0).submit; //第一个表单提交//{o := WebBrowser1.oleobject.document.all.item('btn_Sure',0); //或者用指定表单名称提交o.Click; 以上老是报错哦比如:http://www.ip138.com/sj/一个输入框mobile,一个提交按妞submit 网页源文件例子<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>新建网页 1</title><script>function aa(){ alert("你好")}</script></head><body><form method="POST" action="--WEBBOT-SELF--"> <p><input type="button" value="按钮" name="B3" onclick="aa()"></p></form></body></html>Delphi源码例子unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, OleCtrls, SHDocVw_TLB, EmbeddedWB;type TForm1 = class(TForm) EmbeddedWB1: TEmbeddedWB; Button1: TButton; procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);var doc: OleVariant; i:integer;begin doc:=EmbeddedWB1.document; for i:=0 To doc.all.length-1 do begin if (doc.all.item(i).tagName = 'INPUT')and (doc.all.item(i).name ='B3') then doc.all.item(i).click; end;end;procedure TForm1.FormCreate(Sender: TObject);begin EmbeddedWB1.Navigate('C:\Documents and Settings\Administrator\桌面\index.htm');end;end. 用delphi2006开发的有多少? 【高分/探讨】网络自动搜索+信息解析 请教关于文件的读写存储问题,希望有人能够帮我! 较难问题哦,高手请进。 将临时表赋给DataSource.DataSat属性,如果用SQL语句对它查询? 大虾请进,小小菜鸟相请,MessageDlg救急!!! 奇怪的问题,大家来帮我诊断一下 获取硬盘序列号 table 打开出错了,要改结构,怎么办? 向各位高手请教 经纬度转化 用DELPHI制作一个闹钟程序
o : Olevariant;
o := WebBrowser1.OleObject.document.all.item('User_Id',0); //找到登录用户名的输入框
//o.value := '0096';
o.value :=id;
o := WebBrowser1.oleobject.document.all.item('password',0); //找到登录密码的输入框
//o.value := '0096';
o.value :=password;
//WebBrowser1.oleobject.document.Forms.Item('btn_Sure', 0).submit; //第一个表单提交
//{
o := WebBrowser1.oleobject.document.all.item('btn_Sure',0); //或者用指定表单名称提交
o.Click;
比如:http://www.ip138.com/sj/
一个输入框mobile,一个提交按妞submit
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
<script>
function aa(){
alert("你好")
}
</script>
</head><body><form method="POST" action="--WEBBOT-SELF--">
<p><input type="button" value="按钮" name="B3" onclick="aa()"></p>
</form></body></html>Delphi源码例子
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, SHDocVw_TLB, EmbeddedWB;type
TForm1 = class(TForm)
EmbeddedWB1: TEmbeddedWB;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
doc: OleVariant;
i:integer;
begin
doc:=EmbeddedWB1.document;
for i:=0 To doc.all.length-1 do
begin
if (doc.all.item(i).tagName = 'INPUT')and (doc.all.item(i).name ='B3') then
doc.all.item(i).click;
end;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
EmbeddedWB1.Navigate('C:\Documents and Settings\Administrator\桌面\index.htm');
end;end.