10 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/perl
use strict;
use warnings;
use HTTP::Cookies::Microsoft;
use LWP::UserAgent;
my $username = getlogin;
my $cookie_dir = "C:/Dokumente und Einstellungen/$username/Cookies/";
my $cookie_jar = HTTP::Cookies::Microsoft->new(
file => "$cookie_dir/index.dat",
delayload => 1 );
my $UA = LWP::UserAgent->new( cookie_jar => $cookie_jar );
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#! C:/perl/bin/perl.exe -w
# use strict;
use warnings;
use HTTP::Cookies::Microsoft;
use LWP::UserAgent;
use FileHandle();
new FileHandle();
my %fhs=();
my $username = getlogin;
my $cookie_dir = "C:/Dokumente und Einstellungen/$username/Cookies/";
my $cookie_jar = HTTP::Cookies::Microsoft->new(
file => "$cookie_dir/index.dat",
delayload => 1 );
my $UA = LWP::UserAgent->new( cookie_jar => $cookie_jar );
$TestFile3 = "testhtml.html";
my $fh = new FileHandle($TestFile3,"w");
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;
my $response = $ua->get('[URL=http://server.de/seite/seite']http://server.de/seite/seite'[/URL]);
if ($response->is_success) {
print ($fh $response->content );
}
else {
die $response->status_line;
}
$fh->close();
exit(0);
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
33
34
35
36
#! C:/perl/bin/perl.exe -w
use strict;
use warnings;
use HTTP::Cookies::Microsoft;
use LWP::UserAgent;
use FileHandle();
new FileHandle();
my %fhs=();
my $username = getlogin;
my $cookie_dir = "C:/Dokumente und Einstellungen/$username/Cookies/";
my $cookie_jar = HTTP::Cookies::Microsoft->new(
file => "$cookie_dir\\index.dat",
delayload => 1 );
my $UA = LWP::UserAgent->new( cookie_jar => $cookie_jar );
$UA->timeout(10);
$UA->env_proxy;
my $response = $UA->get('[URL=http://single.de/profil/testusteron']http://single.de/profil/testusteron'[/URL]);
my $TestFile3 = "testhtml.html";
my $fh = new FileHandle($TestFile3,"w");
if ($response->is_success) {
print ($fh $response->content ); # or whatever
}
else {
die $response->status_line;
}
$fh->close();
exit(0);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use strict;
use warnings;
use HTTP::Cookies;
use WWW::Mechanize;
my $cookie_jar = HTTP::Cookies->new();
my $your_url = 'http://url_to_loginpage.tld';
my $mech = WWW::Mechanize->new(-cookie_jar => $cookie_jar);
$mech->get( $your_url );
$mech->submit_form(
form_number => 1, # wievieltes Formular ist das Login-Form
fields => {
username => 'mungo',
password => 'lost-and-alone',
}
);
print $mech->content(); #sollte von eingeloggter Seite sein...
10 Einträge, 1 Seite |