Leser: 3
|< 1 2 3 >| | 22 Einträge, 3 Seiten |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#!/usr/bin/perl use strict; use warnings; local $/; my $html = <DATA>; (my $neu = $html) =~ s/<[^>]*>//gs; print $neu; __DATA__ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Frosch Test</title> </head> <body> <div>Die Bedingung <pre>4 < 5 </pre> ist wahr!</div> </body> </html>
1
2
3
4
5
6
7
8
9
10
11
fral20857@fral20857:~$ perl froschpopo.pl
Frosch Test
Die Bedingung 4 ist wahr!
fral20857@fral20857:~$
Quoteund wird < geschrieben
1
2
3
Hallo <!-- Kommentar <i> Auch noch Kommentar! </i> -->
<a onclick="alert(4>5)">foo</a>
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 26 27 28
#!/usr/bin/perl use strict; use warnings; use HTML::Parser; use LWP::Simple; use Data::Dumper; my $url = '[URL=http://foo-magazin.de]http://foo-magazin.de[/URL]'; #my $url = '[URL=http://de.wikipedia.org/wiki/Perl]http://de.wikipedia.org/wiki/Perl[/URL]'; my $content = get($url); if( $content ){ my @text_parts; my $parser = HTML::Parser->new(); $parser->ignore_elements(qw/head/); $parser->handler( text => sub{ push @text_parts, grep{!/^[\s\n]*$/}@_ }, "dtext" ); $parser->handler( comment => sub {""} ); $parser->parse($content); print Dumper(\@text_parts); }
|< 1 2 3 >| | 22 Einträge, 3 Seiten |