Thread Code für HTML::Parser korrekt? (19 answers)
Opened by Gast at 2010-03-01 19:48

Gast Gast
 2010-03-02 16:11
#133916 #133916
Mit HTML::TreeBuilder::XPath habe ich regex im XPath hinbekommen mit HTML::Query nicht:

Code (perl): (dl )
1
2
3
4
5
6
7
8
use HTML::TreeBuilder::XPath;
my $tree= HTML::TreeBuilder::XPath->new;

$tree->parse_file( 'temp_html.html');
my @v=$tree->findnodes_as_strings( '//li/a[@title=~ /Bra/]' );

say for @v;
$tree->delete;

Code (perl): (dl )
1
2
3
4
5
6
use HTML::Query 'Query';
my @p = Query( file  => 'temp_html.html', 'li a[title]'  ); 

for ( @p ) {
    say $_->as_trimmed_text if $_->as_trimmed_text =~ /Bra/;
}


CPAN == Wildwuchs

View full thread Code für HTML::Parser korrekt?