Question 6: A Perl solution
use WWW::Mechanize;
use XML::LibXML;
my $start_url = 'http://hackoff.apps.mclean.net.nz/spreadsheet/question-001';
my @cols = 'A' .. 'Z';
my @rows = 1 .. 100;
my $cell_data;
my $ua = WWW::Mechanize->new();
$ua->ssl_opts( verify_hostname => 0, SSL_verify_mode => 0x00);
$ua->get($start_url);
foreach my $q (1..110) {
say "URL: " . $ua->uri;
open my $fh, '>', 'log.html';
print $fh $ua->content;
close($fh);
my $doc = parse_html($ua->content);
my $formula = $doc->findvalue(q{//input[@name='formula']/@value})
or die "Failed to extract formula";
say "Formula: $formula";
extract_data($doc);
my $solution = solve($formula);
say "Solution: $solution";
$ua->submit_form(fields => { solution => $solution });
}