Thread HTML Formulare Parsen (3 answers)
Opened by esskar at 2004-04-15 23:06

format_c
 2004-04-15 23:17
#81611 #81611
User since
2003-08-04
1706 Artikel
HausmeisterIn
[Homepage] [default_avatar]
So?
Code: (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 HTML::Parser;
my $re_id = '';
my $html = qq~
<p align="center">
<a href="http://www.no-obstacle.de">No Obstacle</a>
<input type="hidden" name="REQUEST-ID" value="eine ID" />
</p>
</html>
~;

my $p = HTML::Parser->new(api_version => 3,
start_h => [\&start_handler,"tagname,attr,self"])->parse($html);

sub start_handler {
my ($tag,$attr,$self) = @_;
return unless $tag eq 'input';
return unless lc $attr->{type} eq 'hidden' && $attr->{name} eq 'REQUEST-ID';
$re_id = $attr->{value};
$self->eof;
}

print $re_id,"\n";


Gruß Alex\n\n

<!--EDIT|format_c|1082057068-->

View full thread HTML Formulare Parsen