The previous question showed that fldin the following code nil.
procedure TForm1.Button2Click(Sender: TObject);
var
doc: IHTMLDocument2;
frm: IHTMLFormElement;
fld: IHTMLInputTextElement;
begin
doc := webbrowser1.Document as IHTMLDocument2;
frm := doc.forms.item(0, EmptyParam) as IHTMLFormElement;
fld := frm.item('login', EmptyParam) as IHTMLInputTextElement;
I have a TWebBrowser which is sent to mail.com and I wonder why it frm.itemreturns nil. This leads me to the fact that I can not fill out the field. On another site, for example gmail.com, it works when I fill out "email" instead of "login".
I am sure the name of the field is "login" because I can find this from the HTML: page <input type="text" name="login" id="login" class="text" ...>.
source
share