Re: Entering data into fields in a web form
Re: Entering data into fields in a web form
- Subject: Re: Entering data into fields in a web form
- From: julifos <email@hidden>
- Date: Sun, 02 Feb 2003 13:34:01 +0100
>
Hello,
>
I am trying to enter data in a web form to avoid copying and pasting
>
one field at a time. Here is the script I am using. Netscape comes
>
forward but the data is not entered in the fields. Is this possible
>
with Applescript? If not is there a way to do it?
I'd try better IE, whose command "do script" to access DOM via javascript
is extremely powerfull. A brief example to enter data in forms (open
Google):
set jscode to "document.f.q.value='whatever';
document.f.submit();"
-- f: name of the form (look at page's source code)
-- q: name of text field to fill
-- value: value
-- submit(): javascript method to submit a form
tell application "Internet Explorer"
do script jscode
end tell
If you don't know elements' names or elements have no name, you can access
them by index:
Set jscode to "document.forms[0].elements[0].value='whatever'"
Anyway, you could send the remote app which will process the info the data,
just as the browser does it. Same result, different concept:
tell application "Internet Explorer"
GetURL "
http://www.google.com/search?hl=en&ie=ISO-8859-1&q=whatever"
end tell
--> hl: language, a hidden field into the form
--> ie: codification
--> q: query, the value you "entered" into the text field, url-encoded
JJ
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.