Re: Auto Fill Web Forms
- From: "Maarten Wiltink" <maarten@xxxxxxxxxxxxxxxxxx>
- Date: Sun, 24 Apr 2005 13:19:27 +0200
"Zathras" <webnewsgroup@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:dhqi6157fh9da3hpk8ausb8ak4hngnm0lf@xxxxxxxxxx
> I've spent days on the net (Google/MSDN etc) trying to find a way to
> fill in web forms from my Delphi application. I don't want to buy
> ready-made code or an existing application as I want to learn how to
> do this myself.
Read the HTML 4.01 spec at w3.org. Chapter 17 is about forms.
> Basically I want my Delphi app to open a browser window (via
> ShellExecute?) and automatically fill in a form or pop-up form that
> the browser displays.
Brr. You most definitely don't want to do that.
> I guess the tasks are to
>
> 1/ Find the topmost window of the application my app starts
> 2/ Enumerate all the controls
Parse the HTML document into an element tree and find all the INPUT
elements within the FORM elements. Using an existing HTML parser is
good for this, but displaying it in a window is an unnecessary step.
> 3/ Fill in the appropriate controls
This too is an unnecessary step. Submitting the form results in an
HTTP request being sent to a web server... unless JavaScript is used
to do something else. It often is, and no punishment can be harsh
enough for the Webmeister types who've convinced themselves they can't
do without it.
I haven't looked but chapter 17 may detail how form submissions are
done, too. If it doesn't, read the HTTP (1.0) spec about parameters
with GET requests, and with POST requests. The effect is the same
but the intention was once different, and the mechanism still is.
Once you know what the form looks like, you can construct the right
HTTP request to "submit" it. No browser required.
Windows, incidentally, has nothing to do with this.
Groetjes,
Maarten Wiltink
.
- Follow-Ups:
- Re: Auto Fill Web Forms
- From: Zathras
- Re: Auto Fill Web Forms
- References:
- Auto Fill Web Forms
- From: Zathras
- Auto Fill Web Forms
- Prev by Date: Re: Faster way of making long string?
- Next by Date: Re: Faster way of making long string?
- Previous by thread: Re: Auto Fill Web Forms
- Next by thread: Re: Auto Fill Web Forms
- Index(es):
Relevant Pages
|