Leser: 24
1
2
3
4
5
6
7
8
use LWP;
my $browser = LWP::UserAgent->new();
my $url = "http://www.handelsblatt.com/default.aspx?_p=73&wp1_symbol=MAN.FSE&wp1_t=wp1_quoteshistory";
my $seite = $browser->post($url,[/ctl00$ctl00$ctl22$ctl00$ctl02$DD_Year/ => 2000]);
$seite = $seite->decoded_content;
my $seite = $browser->post($url,[ '/ctl00$ctl00$ctl22$ctl00$ctl02$DD_Year/' => 2000]);
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
29
30
31
32
use strict;
use warnings;
use LWP;
my $browser = LWP::UserAgent->new();
my $url = q~http://www.handelsblatt.com/default.aspx?_p=73&wp1_symbol=MAN.FSE&wp1_t=wp1_quoteshistory~;
chomp( my $view = <DATA> );
my $seite = $browser->post(
$url,
{
'ctl00$ctl00$ctl22$ctl00$ctl02$DD_Day' => '1',
'ctl00$ctl00$ctl22$ctl00$ctl02$DD_Month' => '1', # Monat: Januar
'ctl00$ctl00$ctl22$ctl00$ctl02$DD_Year' => '2000',
'ctl00$ctl00$ctl22$ctl00$ctl02$Txt_Time' => '23:59',
'ctl00$ctl00$ctl22$ctl00$ctl02$DD_Lines' => '20',
'ctl00$ctl00$ctl22$ctl00$ctl02$DD_Step' => '2', # Darstellung: Tage
'__VIEWSTATE' => $view,
},
);
if ($seite->is_success) {
print "$_\n" for $seite->decoded_content =~ /\s(\d\d\.\d\d\.\d\d)\s/g;
}
else {
die $seite->status_line;
}
__DATA__
# Hier den Wert von __VIEWSTATE einfügen
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 29 30 31
use LWP; my $browser = LWP::UserAgent->new(); my $url = q~http://www.handelsblatt.com/default.aspx?_p=73&wp1_symbol=MAN.FSE&wp1_t=wp1_quoteshistory~; chomp( my $view = <DATA> ); my $seite = $browser->post( $url, { 'ctl00$ctl00$ctl22$ctl00$ctl02$DD_Day' => '1', 'ctl00$ctl00$ctl22$ctl00$ctl02$DD_Month' => '1', # Monat: Januar 'ctl00$ctl00$ctl22$ctl00$ctl02$DD_Year' => '1998', 'ctl00$ctl00$ctl22$ctl00$ctl02$Txt_Time' => '23:59', 'ctl00$ctl00$ctl22$ctl00$ctl02$DD_Lines' => '100', 'ctl00$ctl00$ctl22$ctl00$ctl02$DD_Step' => '2', # Darstellung: Tage '__VIEWSTATE' => $view, }, ); $seite = $seite->decoded_content; $out = "MAN1.html"; open(OUT ,">$out") ||die ("Kann $out nicht oeffnen!!"); printf OUT ("$seite"); close (OUT);