|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
MechanizeHello
I would like to be
able to login automatically into site 123.45.67.89 by providing a user name
and a password and print the first page after the login
screen.
I am using the
script below which always prints the login.asp screen instead of the
firstpage.asp screen.
I am running perl
5.8.7 on a windows 2000 system
Any ideas how to
solve the issue will be greatly appreciated.
Thanks
Erich
#!/usr/bin/perl
use WWW::Mechanize; use HTTP::Cookies; # Username
my $username = "my_name"; # Password
my $password = "my_password"; # Create a new instance of WWW::Mechanize
my $mechanize = WWW::Mechanize->new(autocheck => 1); # Supply the necessary
credentials
$mechanize->credentials($url, $username, $password); # Manage
cookies
$mechanize->cookie_jar(HTTP::Cookies->new); # Retrieve the desired
page
$mechanize->get("http://123.45.67.89/firstpage.asp"); # Assign the page content to $page
my $page = $mechanize->content; # Output the page
print $page; _______________________________________________ ActivePerl mailing list ActivePerl@... To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs |
|
|
|
| Free Forum Powered by Nabble | Forum Help |