Leser: 1
|< 1 2 3 >| | 26 Einträge, 3 Seiten |
<tr><td>CLIENTS=SITA_FRA_FRA4LHR007 ARINC_FRA_WS1566452 </td></tr>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /usr/bin/perl
use strict;
use warnings;
use HTML::Parser;
my @links;
my $string = qq~<<tr><td>CLIENTS=SITA_FRA_FRA4LHR007 ARINC_FRA_WS1566452 </td></tr>text~;
my $p = HTML::Parser->new();
$p->handler(start => \&start_handler,"tagname,attr,self");
$p->parse($string);
foreach my $client(@clients){
print $_,"\n" if($_);
}
sub start_handler{
return if(shift ne 'td');
my ($class) = shift->{href};
my $self = shift;
my $text;
$self->handler(text => sub{$text = shift;},"dtext");
$self->handler(end => sub{push(@clients,split(/\ /,$text)) if(shift eq 'td')},"tagname");
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use strict;
use warnings;
use LWP::Simple;
use HTML::Parser;
my $file = "site1.txt";
my $url = 'http://user:pwd@my-home-page.de';
my $content = getstore($url,$file);
my @infos;
my $p = HTML::Parser->new();
$p->handler(start => \&start_handler,"tagname,attr,self");
$p->parse_file('$file');
sub start_handler{
return if(shift ne 'td');
my ($client) = shift->{CLIENTS}=~ /\s+(.+)/;
print "$client\n";
}
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 LWP::Simple;
use HTML::Parser;
my @clients;
my $file = "site1.txt";
my $url = 'http://user:pwd@my-home-page.de';
my $content = getstore($url,$file);
my $p = HTML::Parser->new();
$p->handler(start => \&start_handler,"tagname,attr,self");
$p->parse_file($file);
foreach my $client(@clients){
print $_,"\n" if($_);
}
sub start_handler{
return if(shift ne 'td');
my ($class) = shift->{href};
my $self = shift;
my $text;
$self->handler(text => sub{$text = shift;},"dtext");
$self->handler(end => sub{push(@clients,split(/\ /,$text)) if(shift eq 'td')},"tagname");
}
|< 1 2 3 >| | 26 Einträge, 3 Seiten |