As an alternative for writing the scripts you might look at
HTTP::Recorder for a tool for recording interactive web sessions as scripts (the language used is perl itself). There is an article on perl.com about it:
Web Testing with HTTP::Recorder by Linda Julien.