I've done many scripts like this in WWW::Automate using perl. That library should be included with LWP::UserAgent.<br>
<br>
It's quite reliable and very easy to use (assuming you know perl). I'd
highly recommend it to anyone seeking any sort of webautomation.<br><br><div><span class="gmail_quote">On 12/8/06, <b class="gmail_sendername">Ralph Mitchell</b> <<a href="mailto:ralphmitchell@gmail.com">ralphmitchell@gmail.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On 12/8/06, Henrik Stoerner <<a href="mailto:henrik@hswn.dk">henrik@hswn.dk
</a>> wrote:<br>> I've done it for one or two sites, and abandoned it because it is<br>> incredibly fragile when dealing with real-world websites. You're<br>> basically going to mimic the behaviour of a browser, but you probably
<br>> don't have an engine that is fully capable of handling JavaScript,<br>> cookies, automated redirects and form submissions like a real browser<br>> does.<br><br>Curl handles cookies, redirects that happen via Location headers, and
<br>form submissions, for both regular sites and secure sites.<br><br>My scripts all evolved under Big Brother, so they're all Bourne shell,<br>using curl, grep, sed, head, tail, etc to process the pages.  There's<br>a perl script on the curl home page (
<a href="http://curl.haxx.se">http://curl.haxx.se</a>) called<br>formfind.pl, which pulls out form elements.  I've got a hacked up copy<br>of formfind.pl that hands me the form in a format suitable for posting<br>back using curl.
<br><br>I used to have a script that logged into an airline booking system,<br>picked out flights, and went through the whole booking sequence,<br>stopping right before it would have had to enter credit card details.<br>That was about 19 steps, I think.
<br><br>You don't necessarily have to be able to process javascript.  A lot of<br>forms just use it to verify the data, which you can ignore.  I've run<br>into a few that used javascript to modify the form variables and store
<br>the results into other form variables, but those aren't too hard to<br>deal with once you understand what's happening.<br><br>Probably the worst thing I've had to deal with was a page that<br>assembled a new url from bits of the form elements, then jumped to it
<br>by setting location.href=[newurl].  That kind of thing almost has to<br>be hardwired, and as Henrik says, that has a tendency to be a bit<br>fragile.<br><br>I think I've got an example script somewhere.  If I can find it, I'll post it.
<br><br>Ralph Mitchell<br><br>To unsubscribe from the hobbit list, send an e-mail to<br><a href="mailto:hobbit-unsubscribe@hswn.dk">hobbit-unsubscribe@hswn.dk</a><br><br><br></blockquote></div><br>