View Single Post
Old 08-24-2008   #7 (permalink)
Al Dunbar


 
 

Re: Using sendkeys in a web form


"James Whitlow" <jwhitlow.60372693@xxxxxx> wrote in message
news:udhHHOWBJHA.2476@xxxxxx
Quote:

> "LuisE" <legonzales@xxxxxx> wrote in message
> news:433ED65F-7746-4235-867A-BE58AF0C2338@xxxxxx
Quote:

>> Thanks James, it works fine.
>>
>> In your code, what should I change if I need to use different fields of
>> the
>> form?
>
> You will need to look at the source code of the page to determine that.
> In the example you posted, I right clicked, selected 'View Source' and
> searched for 'Booking Date:' & then 'Date:' under that. I searched up for
> 'action' to find the post URL. I then looked at the names of the input
> fields. The date field is named 'Date' & the Report radio buttons are
> named 'report'. Just take the Post URL, add a question mark and then the
> field names followed by an equal sign and the value you wish to pass.
> Separate the fields with ampersands. In this case, I added
> '?Date=082208&report=D' to the end of the Post URL.
>
> I am not sure of a way to get the field names other than digging
> through the HTML source code. There are probably others in the group that
> can offer you a better way to do this. Firefox 2.x used to provide the
> fields names in 'View Page Info', but Firefox 3.x does not.
>
> If you have trouble with the above, just advise the field names you are
> looking for and either myself of someone else from the group can probably
> help you determine them.
Most web pages are designed to present the human user an interface with
visual clues that make it intuitively obvious how to interact with the page
using keyboard and mouse via common controls and navigation standards. You
could develop two pages that looked and operated exactly the same, but using
completely different HTML coding underneath, so I suspect that James'
statement that "You will need to look at the source code of the page" is
right on the money.

Not only that, but you might find that internal changes in the page you are
accessing might eventually break your external code.

I wonder if a standard will eventually arise (a document object model
approach, perhaps) that will make web pages more navigable by external
script. This could, of course, result in fewer ads being seen, so perhaps
there are forces working against this approach.

/Al


My System SpecsSystem Spec