Jack, >>>BTW, how do you simulate clicking a button with TWebBrowser?
You can access all items on a web page as objects, and Microsoft supply different interfaces for each object. For example, most if not all items on a page implement the IHTMLElement interface. Using this interface and casting the Document property of the TWebBrowser as an IHTMLDocument2 interface, you can process through all of the items when a page is loaded (this is important, as the TWebBrowser component will only finish loading a page when it is visible, so you can place it off your visible Delphi form if you have a form but don't wish to display the actual web page). From there you can supply values for input boxes (IHTMLInputElement), perform clicking as though using the mouse or fill in fields and select items from comboboxes (IHTMLSelectElement). Using the UILess code on www.euromind.com, you could achieve something that could completely automate web page processing whilst still retaining any of the business rules behind the page itself without requiring a user interface (my needs are to automate a backoffice printing system and automatically drop printed documents to a logical printer which produces PDF documents and automatically loads them into the document management system). At least that's the theory which I am trying to prove. Kind regards, Darren -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jack Sent: 23 December 2005 14:29 To: Borland's Delphi Discussion List Subject: Re: Automate Internet Explorer Hello Darren, How about using an http component such as the one in ICS? You can do it from the protocol level. BTW, how do you simulate clicking a button with TWebBrowser? -- Best regards, Jack Thursday, December 22, 2005, 9:27:50 PM, you wrote: > All, > I am trying to automate IE using Delphi in a process that can load a > web page, fill in some fields, simulate the clicking of a button and > navigating to the page that resulted from the simulated click and then > processing it in the same manner. > I could achieve this with the TWebBrowser component, but all of the > IHTMLElements are not loaded until the TWebBrowser finishes loading > the first page, and the first page will not load if the TWebBrowser > component is not actually visible on the screen. > I have been to the great www.euromind.com site, and have used the > UILess version written by Per. Unfortunately, I do not know how to > handle the clicking of a button on the loaded HTML page using the > component. I know how to click the button, but a visible Explorer > window appears when I do it, and then my Explorer process crashes. > The steps needed are: > 1. Load web page using UILess or some other mechanism > 2. Auto-select combo box option from HTML page > 3. Simulate clicking of button to proceed to next page > 4. Load next web page > 5. Fill in form fields > 6. Simulate clicking of button to post form data > 7. Close browser > The reason for doing this is to automate a web-based document > management system which has no API of its own, and all the business > rules are written into the UI logic. This logic must also be reusable > from any kind of application, including Windows Service programs. Any suggestions welcome. > Many thanks and seasons greetings, > Darren > _______________________________________________ > Delphi mailing list -> [email protected] > http://www.elists.org/mailman/listinfo/delphi _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

