Hi Dan,<br><br>I've done this in C# using 'WatiN' <<a href="http://watin.sourceforge.net">http://watin.sourceforge.net</a>> and also in Python using 'pywinauto' <<a href="http://pywinauto.openqa.org">http://pywinauto.openqa.org</a>> and PAMIE <<a href="http://sourceforge.net/projects/pamie">http://sourceforge.net/projects/pamie</a>>. The WatiN page also references a project for ruby called Watir <<a href="http://wtr.rubyforge.org">http://wtr.rubyforge.org</a>> but I have not used it. <br>
<br>I haven't done this kind of thing from a Mac.<br><br>Watir works on Mac, but like I said, I have not tried it. That would be my first approach if I were working from a Mac.<br><br>One thing which helps alot is a Firefox plugin called 'Firebug' <<a href="http://www.getfirebug.com">http://www.getfirebug.com</a>>. It can help you quickly navigae javascript and identify elements of interest in page source. (There's also a devloper toolbar for IE which fills a similar need, but I haven't seen anything for Safari...)<br>
<br>Happy hacking!<br><br><br>-Loren<br><br><div class="gmail_quote">On Sun, Jan 11, 2009 at 7:18 PM, Dan Martin <span dir="ltr"><<a href="mailto:ummar143@shaw.ca">ummar143@shaw.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Problem: to automatically fill form fields in a web page based on<br>
changing criteria.<br>
<br>
I am sure this problem crops up in a number of areas. In my case, I<br>
place buy and sell orders (different variations) for stocks on my<br>
broker's web page. By the time I enter all the info and go through<br>
one or two confirmatory screens, the price has often changed and the<br>
order cannot be executed.<br>
<br>
I would like to have a script that would offer me a choice of trading<br>
account and stock to select. It would then calculate how many shares<br>
I could afford from the given account, and enter the info into the web<br>
page and subsequent pages, perhaps stopping before the very final<br>
confirmation. Ideally, I would like visual confirmation of what has<br>
happened.<br>
<br>
It appears that the broker's web page (https) contains Java script<br>
forms.<br>
<br>
Possible Solutions:<br>
1) Use Applescript to control the Safari web browser on my Mac.<br>
Applescript can call a bash shell (or vice versa) to allow programmed<br>
control.<br>
2) A perl script using "mech" (WWW::Mechanize).<br>
3) A script which calls curl.<br>
4) other?<br>
<br>
I am unfamiliar with these technologies, and I have only a vague idea<br>
about how they would work.<br>
<br>
Does anyone have suggestions on these or other approaches?<br>
<br>
Dan Martin<br>
GP Hospital Practitioner<br>
Computer Scientist<br>
<a href="mailto:ummar143@shaw.ca">ummar143@shaw.ca</a><br>
(204) 831-1746<br>
until Jan 21: (204) 219-6685<br>
answering machine always on<br>
<br>
_______________________________________________<br>
Roundtable mailing list<br>
<a href="mailto:Roundtable@muug.mb.ca">Roundtable@muug.mb.ca</a><br>
<a href="http://www.muug.mb.ca/mailman/listinfo/roundtable" target="_blank">http://www.muug.mb.ca/mailman/listinfo/roundtable</a><br>
</blockquote></div><br>