Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: I need to control a browser, enter data in a field and click "Submit"


This question is answered.


Permlink Replies: 1 - Last Post: Nov 9, 2017 10:45 AM Last Post By: Remy Lebeau (Te...
Kevin Morris

Posts: 52
Registered: 1/8/13
I need to control a browser, enter data in a field and click "Submit"  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 9, 2017 9:50 AM
I can use Delphi XE3 or Delphi XE7. I need to communicate with a web site using a browser. I need to enter data into an edit box, then click the "Submit" button. My knowledge in this area is that there is a TWebBrowser component... that is all I know. How do I communicate with the different objects in the web page displayed in TWebBrowser?

How can I accomplish this? Thanks in advance for any help you can provide.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: I need to control a browser, enter data in a field and click "Submit"
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 9, 2017 10:45 AM   in response to: Kevin Morris in response to: Kevin Morris
Kevin Morris wrote:

I need to communicate with a web site using a browser.

Why? TWebBrowser is a visual component, and what you are asking for
should be handled in a non-visual manner, such as with Indy's TIdHTTP
component.

I need to enter data into an edit box, then click the "Submit"
button.
My knowledge in this area is that there is a TWebBrowser component...
that is all I know. How do I communicate with the different objects
in the web page displayed in TWebBrowser?

Assuming you are using VCL's TWebBrowser component and not FMX's, then
the browser exposes access to the elements of the web page via DOM
interfaces (IHTMLDocument2, IHTMLInputElement, etc). You would have to
retreive the IHTMLDocument... interface of the browser's Document, and
then search it for the DOM elements you are interested in, and then use
their interface properties to manipulate them as needed.

There are numerous examples of them, if you search online.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02