6 my $q = 'TS=psychology AND AD=Croatia';
9 use Data::Dump qw/dump/;
11 my $mech = WWW::Mechanize->new(
19 my ( $mech, $path ) = @_;
21 $path ||= sprintf('/tmp/isi.%02d.%s', $step, $mech->{ct} =~ m{html}i ? 'html' : 'txt' );
22 $mech->save_content( $path );
23 warn "# [$step] $path ", -s $path, " ", $mech->ct;
28 $mech->get( 'http://isiknowledge.com/?DestApp=WOS' );
31 warn "# advanced serach";
32 $mech->follow_link( url_regex => qr/AdvancedSearch/ );
35 warn "# cookie_jar ", dump $mech->cookie_jar;
39 'value(input1)' => $q,
45 $mech->follow_link( url_regex => qr/summary/ );
53 my $to = $from + $range_size;
56 form_name => 'summary_output_form',
58 record_select_type => 'range',
63 qo_fields => 'fullrecord',
64 citedref => 'citedref',
66 save_options => 'plain_text',
75 last if $mech->content =~ m{invalid API call};
78 $mech->follow_link( url_regex => qr/save_file/ );
79 save_mech $mech => "/tmp/isi.$q.$from-$to.txt";