Changeset 29595 for lang/perl/WWW-PASMO

Show
Ignore:
Timestamp:
02/06/09 00:59:26 (4 years ago)
Author:
hetappi
Message:

WWW::Mechanize::Pluggable!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/WWW-PASMO/trunk/lib/WWW/PASMO.pm

    r29448 r29595  
    55our $VERSION = '0.00'; 
    66 
    7 use WWW::Mechanize; 
     7use WWW::Mechanize::Pluggable; 
    88use Web::Scraper; 
    99 
     
    1111    my ($class, %opt) = @_; 
    1212    my $self = bless { 
    13         mech => WWW::Mechanize->new 
     13        mech => WWW::Mechanize::Pluggable->new 
    1414    }, $class; 
    1515    $self; 
     
    3131    my ($self) = @_; 
    3232 
    33     my $resp = $self->{mech}->follow_link( url => 'CardStatusWebForm.aspx' ); 
    34     scraper { 
    35         process '//form/table[2]/tr[4]/td/table/tr[9]/td/table/tr[@bgcolor="#eeeeee"]', 
    36             'histories[]' => scraper { 
     33    $self->{mech}->follow_link( url => 'CardStatusWebForm.aspx' ); 
     34    $self->{mech}->scrape( 
     35        '//form/table[2]/tr[4]/td/table/tr[9]/td/table/tr[@bgcolor="#eeeeee"]', 
     36            'histories[]', scraper { 
    3737                process '//td[1]', 'date' => [ 'text', sub { s!(\d{2})(\d{2})!$1/$2! } ]; 
    3838                process '.', 'info1' => scraper { 
     
    4545                }; 
    4646                process '//td[6]', 'balance' => [ 'text', sub { s/^\*+// } ]; 
    47             }; 
    48     }->scrape($resp); 
     47            }); 
    4948} 
    5049