use strict;
use HTML::TreeBuilder::XPath;
use LWP::UserAgent;
use LWP::Simple qw(getstore);
my $result = 0;
my $dl_url = "http://www.xxx.de/";
my $url = "http://www.xxx.de/index.php?id=0,20";
my $ua = LWP::UserAgent->new;
my $response = $ua->get($url);
if (not $response->is_success) { $result = 1; }
print $result."\n";
my $tree= HTML::TreeBuilder::XPath->new;
$tree->parse($response->decoded_content);
my @titles = $tree->findnodes( '//h4/a');
for my $tit (@titles) {
my $title = $tit->findvalue('@title');
my $download = $tit->findvalue('@href');
print $title."\n".$download."\n";
my $dl_url_complete = $dl_url.$download;
print $dl_url_complete."\n";
exit;
my $ua = LWP::UserAgent->new();
my $response = $ua->get($dl_url_complete);
die $response->status_line if !$response->is_success;
my $file = $response->decoded_content( charset => 'none' );
#my $md5_hex = md5_hex($file);
#print "$md5_hex\n";
my $save = $title.".pdf";
getstore($url,$save),
}