Thread Wie komme ich an die SessionID
(4 answers)
Opened by ArexX at 2007-12-01 20:00 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 use LWP; use HTML::Parser; $url = 'xx'; $ua = LWP::UserAgent->new(); $form = $ua->get($url) or die "Couldn't fetch $url"; $form->is_success() or die $form->message(); print $form->content(); my $session = ""; my $parser = HTML::Parser->new; $parser->handler(start => \&start_handler,"tagname,attr,self"); $parser->parse( $form->content ); print $session; sub start_handler{ my ($tag,$attr,$self) = @_; return unless $tag eq 'form'; my $action = $attr->{action}; ($session) = $action =~ /jsessionid=(.*)/; } OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/) -- Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html Perl-Entwicklung: http://perl-services.de/ |