my $mech = $self->{mech} || die "no mech?";
-print $mech->content;
+#warn "## ", $mech->content;
if ( $mech->content =~ m{Zapis\s+(\d+)}s ) {
my $nr = $1;
-diag "parse $nr";
+warn "parse $nr";
$marc = MARC::Record->new;
$hash = {};
sub field {
my ( $f, $v ) = @_;
$v =~ s/\Q \E/ /gs;
-warn "# $f\t$v\n";
+#warn "## $f\t$v\n";
$hash->{$f} = $v;
my ($i1,$i2) = (' ',' ');
($i1,$i2) = ($2,$3) if $f =~ s/^(...)(.)?(.)?/$1/;
my @sf = split(/\|/, $v);
shift @sf;
@sf = map { s/^(\w)\s+//; { $1 => $_ } } @sf;
-diag "sf = ", dump(@sf);
+#warn "## sf = ", dump(@sf);
$marc->add_fields( $f, $i1, $i2, @sf ) if $f =~ m/^\d+$/;
}
$html =~ s|<tr>\s*<td class=td1 id=bold[^>]*>(.+?)</td>\s*<td class=td1>(.+?)</td>|field($1,$2)|ges;
- diag "# hash ",dump($hash);
+# diag "# hash ",dump($hash);
my $id = $hash->{SYS} || die "no SYS";
use warnings;
use strict;
-use Test::More tests => 4;
+use Test::More tests => 6;
use_ok 'Aleph';
ok( my $hits = $o->search( 'WTI=linux' ), 'search' );
diag "$hits results";
-ok( my $marc = $o->next_marc, 'next_marc' );
+foreach ( 1 .. 3 ) {
+
+ok( my $marc = $o->next_marc, "next_marc $_" );
diag $marc;
+
+}