|
|
|
@ -74,7 +74,6 @@ for $link (@links) {
|
|
|
|
|
my ($invoice) = $url =~ /leg_invoice=(\d+)/; |
|
|
|
|
my $filename = $downloaddir . '/' . $invoice . ".pdf"; |
|
|
|
|
unless (-e $filename) { |
|
|
|
|
# print "Downloading invoice $invoice to $filename from $url\n"; |
|
|
|
|
print "Downloading invoice $invoice to $filename\n"; |
|
|
|
|
downloadbill($url, $filename); |
|
|
|
|
#$mech->mirror($url, $filename); |
|
|
|
@ -83,13 +82,6 @@ for $link (@links) {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#$mech->follow_link( text_regex => qr/log out/ ); |
|
|
|
|
|
|
|
|
|
#print $mech->content(); |
|
|
|
|
|
|
|
|
|
#$mech->dump_forms( undef, $absolute ); |
|
|
|
|
#$mech->dump_links( undef, $absolute ); |
|
|
|
|
|
|
|
|
|
sub follow_processing { |
|
|
|
|
my $url, $attempts; |
|
|
|
|
|
|
|
|
@ -105,7 +97,6 @@ sub follow_processing {
|
|
|
|
|
|
|
|
|
|
$url =~ s/&/&/g; |
|
|
|
|
|
|
|
|
|
# print "Attempt $attempts. Found URL: $url\n"; |
|
|
|
|
print "Waiting for processing. Attempt $attempts.\n"; |
|
|
|
|
|
|
|
|
|
my $newurl = $mech->uri(); |
|
|
|
@ -113,8 +104,6 @@ sub follow_processing {
|
|
|
|
|
$newurl =~ s/\/[^\/]*$//; |
|
|
|
|
$newurl = $newurl . "/" . $url; |
|
|
|
|
|
|
|
|
|
# print "I think I'm going to $newurl\n"; |
|
|
|
|
|
|
|
|
|
$mech->get($newurl); |
|
|
|
|
print "Processing finished.\n"; |
|
|
|
|
} |
|
|
|
|