Board index » delphi » TWebBrowser - simulate key press on HTML page?

TWebBrowser - simulate key press on HTML page?

Thanks to the tip in the SwissDelphiCenter...automatic fill out HTML forms
with TWebBrowser in the forum i've satisfied my first question. Next is how
to locate a button on a HTML page and simulate pressing it? This is in
reference as to filling out the login name and password on a page then
pressing the Submit button or Login button. Any help or code would be
appreciated.
TIA

--
Charlie Chambers
chamb...@dailnet.net

 

Re:TWebBrowser - simulate key press on HTML page?


I suggest you use a different approach:
Pressing the submit button will result in a HTTP GET or POST action.
You can generate a GET action by requestion the target URL and adding the
parameters separated by & after a ? mark after the URL.
You can generate a POST action by using the Post method and supplying the
parameters as data.

"Chambers" <chamb...@dialnet.net> schreef in bericht
news:n4Gx6.2062$Ib.214786@news1.primary.net...

Quote
> Thanks to the tip in the SwissDelphiCenter...automatic fill out HTML forms
> with TWebBrowser in the forum i've satisfied my first question. Next is
how
> to locate a button on a HTML page and simulate pressing it? This is in
> reference as to filling out the login name and password on a page then
> pressing the Submit button or Login button. Any help or code would be
> appreciated.
> TIA

> --
> Charlie Chambers
> chamb...@dailnet.net

Re:TWebBrowser - simulate key press on HTML page?


On Sun, 1 Apr 2001 08:25:28 -0500, "Chambers" <chamb...@dialnet.net>
wrote:

Quote
> Next is how
>to locate a button on a HTML page and simulate pressing it?

Hi,

try this:
Webbrowser1.OleObject.Document.all.item('Submit').Click;

thomas

Other Threads