F
foreachman
Unregistered / Unconfirmed
GUEST, unregistred user!
请问为什么下面得到的网页输入原素(ihtmlinputelement)都是nil呢
var
do
c:IHTMLDocument2;
form:ihtmlformelement;
Custidelement,userinputelement,pwdinputelement:ihtmlinputelement;
Btninput : OleVariant;
begin
try
do
c:= wb1.document as IHTMLDocument2;
Custidelement:=(doc.all.item('CUSTOMERID',0) as ihtmlinputelement);
if Custidelement<> nil then
// 为什么老是nil ?
Custidelement.value:='aaa';
userinputelement:=(doc.all.item('USERID',0) as ihtmlinputelement);
if userinputelement<> nil then
// 为什么老是nil ?
userinputelement.value:='000001';
pwdinputelement:=(doc.all.item('LOG_PWD',0) as ihtmlinputelement);
if pwdinputelement<> nil then
// 为什么老是nil ?
pwdinputelement.value:='bbb';
Btninput:=doc.all.item('log_buttom',0);
Btninput.click ;
except
end;
end;
var
do
c:IHTMLDocument2;
form:ihtmlformelement;
Custidelement,userinputelement,pwdinputelement:ihtmlinputelement;
Btninput : OleVariant;
begin
try
do
c:= wb1.document as IHTMLDocument2;
Custidelement:=(doc.all.item('CUSTOMERID',0) as ihtmlinputelement);
if Custidelement<> nil then
// 为什么老是nil ?
Custidelement.value:='aaa';
userinputelement:=(doc.all.item('USERID',0) as ihtmlinputelement);
if userinputelement<> nil then
// 为什么老是nil ?
userinputelement.value:='000001';
pwdinputelement:=(doc.all.item('LOG_PWD',0) as ihtmlinputelement);
if pwdinputelement<> nil then
// 为什么老是nil ?
pwdinputelement.value:='bbb';
Btninput:=doc.all.item('log_buttom',0);
Btninput.click ;
except
end;
end;