Loading bin/efa +11 −8 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ use warnings; use 5.010; use Getopt::Long qw/:config no_ignore_case/; use HTML::TreeBuilder::XPath; use HTML::TreeBuilder::LibXML; use WWW::Mechanize; my $firsturl = 'http://efa.vrr.de/vrr/XSLT_TRIP_REQUEST2?language=de&itdLPxx_transpCompany=vrr'; Loading Loading @@ -37,8 +37,9 @@ sub check_ambiguous { "Ambiguous input for %s\n", $select->attr('name'), ); foreach my $val ($select->findnodes_as_strings('./option')) { say "\t$val"; foreach my $val ($select->findnodes('./option')) { print "\t"; say $val->as_trimmed_text(); } } if ($ambiguous) { Loading Loading @@ -209,7 +210,7 @@ sub parse_tree { } if ($colspan == 8) { if ($td->as_text() =~ / (?<no> \d+ ) \. .+ Fahrt /x) { if ($td->as_trimmed_text() =~ / (?<no> \d+ ) \. .+ Fahrt /x) { $con_no = $+{'no'} - 1; $con_part = 0; next; Loading @@ -225,8 +226,8 @@ sub parse_tree { } } if (not $td->exists('./img') and $td->as_text() !~ /^\s*$/) { push(@{$cons->[$con_no]->[$con_part]}, $td->as_text()); if (not @{$td->findnodes('./img')} and $td->as_text() !~ /^\s*$/) { push(@{$cons->[$con_no]->[$con_part]}, $td->as_trimmed_text()); } } return $cons; Loading Loading @@ -325,7 +326,9 @@ if ($test_dump) { exit 0 } my $tree = HTML::TreeBuilder::XPath->new_from_content($content); my $tree = HTML::TreeBuilder::LibXML->new(); $tree->parse($content); $tree->eof(); check_ambiguous($tree); Loading test/parse_ambiguous +7 −7 File changed.Contains only whitespace changes. Show changes Loading
bin/efa +11 −8 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ use warnings; use 5.010; use Getopt::Long qw/:config no_ignore_case/; use HTML::TreeBuilder::XPath; use HTML::TreeBuilder::LibXML; use WWW::Mechanize; my $firsturl = 'http://efa.vrr.de/vrr/XSLT_TRIP_REQUEST2?language=de&itdLPxx_transpCompany=vrr'; Loading Loading @@ -37,8 +37,9 @@ sub check_ambiguous { "Ambiguous input for %s\n", $select->attr('name'), ); foreach my $val ($select->findnodes_as_strings('./option')) { say "\t$val"; foreach my $val ($select->findnodes('./option')) { print "\t"; say $val->as_trimmed_text(); } } if ($ambiguous) { Loading Loading @@ -209,7 +210,7 @@ sub parse_tree { } if ($colspan == 8) { if ($td->as_text() =~ / (?<no> \d+ ) \. .+ Fahrt /x) { if ($td->as_trimmed_text() =~ / (?<no> \d+ ) \. .+ Fahrt /x) { $con_no = $+{'no'} - 1; $con_part = 0; next; Loading @@ -225,8 +226,8 @@ sub parse_tree { } } if (not $td->exists('./img') and $td->as_text() !~ /^\s*$/) { push(@{$cons->[$con_no]->[$con_part]}, $td->as_text()); if (not @{$td->findnodes('./img')} and $td->as_text() !~ /^\s*$/) { push(@{$cons->[$con_no]->[$con_part]}, $td->as_trimmed_text()); } } return $cons; Loading Loading @@ -325,7 +326,9 @@ if ($test_dump) { exit 0 } my $tree = HTML::TreeBuilder::XPath->new_from_content($content); my $tree = HTML::TreeBuilder::LibXML->new(); $tree->parse($content); $tree->eof(); check_ambiguous($tree); Loading