Thread Array mit allen verfügbaren Regex-Treffern
(2 answers)
Opened by deanosaurier at 2010-11-01 18:55
So geht es doch einfacher:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 #!/usr/bin/perl use strict; use warnings; use LWP::Simple; use HTML::TreeBuilder; use Data::Dumper; my $html = HTML::TreeBuilder->new(); my $html_data=LWP::Simple::get('http://epicute.icanhascheezburger.com/'); my @data; my @images; if($html_data) { $html->parse($html_data); # nach dem Textarea suchen: for my $tag ( $html->look_down( _tag => 'textarea' ) ) { next if(!$tag->attr('name') || $tag->attr('name') ne 'easyshare2' ); push(@data,$tag->content()->[0]); } } print Dumper(\@data); |