Swiss Dormant Accounts Scraper

It has been quite a while since I have used PERL and this dormant accounts’ web page seemed like a challenge. Since I am always up for a good challenge, here is the solution in good old fashioned PERL.


# Get Rich, Dump stuff from Swiss banks angelos karageorgiou
use HTML::Form;
use WWW::Mechanize;
use HTML::Parser ();
use Data::Dumper;
use HTML::TableExtract;

my $mech = WWW::Mechanize->new();
my $url='';

# first into the page, click on Publications
$mech->get( $url );

my $html = $mech->content();

my $cont=1;
while ($cont) {
    print "-" x 80 ."\n";
    my $form=$mech->form_number(2);
    my $saved_input=undef;
    foreach $input ($form->inputs) {
        if ($input->value eq 'Next') {
    # just in case
    $mech->click_button( input => $saved_input);

sub dump_table () {
 my $html=shift;
 $te = HTML::TableExtract->new( );

 # Examine all matching tables
 foreach $ts ($te->tables) {
   next if $ts->coords == "0,0";
   foreach $row ($ts->rows) {
        foreach $col (@$row) {
            $col=~s/[\s][\s]*/ /g;
            print "'$col' ;";
    print "\n";




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: