Perl, WWW-Mechanize might be useful