10 my $url = 'http://cobiss.izum.si/scripts/cobiss?ukaz=GETID&lani=en';
14 my $mech = WWW::Mechanize->new();
17 warn "# got session\n";
19 $mech->follow_link( text_regex => qr/union/ );
21 warn "# submit search\n";
30 if ( $mech->content =~ m{hits:\s*<b>\s*(\d+)\s*</b>}s ) {
33 warn "get't find results in ", $mech->content;
36 warn "# got $hits results, get first one\n";
38 $mech->follow_link( url_regex => qr/ukaz=DISP/ );
40 warn "# in COMARC format\n";
42 $mech->follow_link( url_regex => qr/fmt=13/ );
46 if ( $mech->content =~ m{<pre>\s*(.+1\..+?)\s*</pre>}s ) {
48 $comarc =~ s{</?b>}{}gs;
49 $comarc =~ s{<(/?font)[^>]*>}{<sf>}gs;
55 die "can't fetch COMARC format from ", $mech->content;