Error to access the website
Anonymous Monk
created: 2006-08-04 09:16:42
Hi Monks,
I am trying to login to website by using www::Mechanize on win perl 5.8.Below is my code.
.
#!/usr/bin/perl
use strict;
 use WWW::Mechanize;
 use HTTP::Cookies;
 use LWP::Debug qw(+); 
 my $outfile = "out.htm";
 my $url = "https://yahoomail.com/";
 my $username = "abcdef";
 my $password = "xxxx";
 my $mech = WWW::Mechanize->new();
 $mech->cookie_jar(HTTP::Cookies->new());
 $mech->get($url);
 $mech->form_name('login');
 $mech->field(login => $username);
 $mech->field(passwd => $password);
 $mech->click();
 $mech->follow_link(text => "click here", n => 1);    
 my $output_page = $mech->content();
 open(OUTFILE, ">$outfile");
 print OUTFILE "$output_page";
 close(OUTFILE);

. after runnig this script it showing an error message,as below
.


.

LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
HTTP::Cookies::add_cookie_header: Checking yahoomail.com for cookies
HTTP::Cookies::add_cookie_header: Checking .com for cookies
LWP::UserAgent::send_request: GET https://yahoomail.com/
LWP::UserAgent::_need_proxy: Not proxied
LWP::UserAgent::request: Simple response: Not Implemented
 There is no form named "login" at weblogin.pl line 13
Can't call method "value" on an undefined value at C:/Perl/site/lib/WWW/Mechaniz
e.pm line 538.

.
. i am not getting any idea to debug it. solution to this problem will be a greate help for me, so that i can proceed further in my task.
. keep pouring your ideas.....

Edited by [planetscape] - added [id://17558|code] tags ( keep:0 edit:14 reap:0 )

2006-08-06 [id://340870|Retitled] by [planetscape], as per Monastery [id://341118|guidelines] ( keep:0 edit:14 reap:0 )
Original title: 'Error to acees the website'

Re: Error to access the website
created: 2006-08-04 09:30:12
  1. Go the URL with your favorite web browser.
  2. Select 'view source' or the equivalent.
  3. Look for a <form> element with the name attribute set to 'login'.

Personally, I can't load the URL at all.

perlmonks.org content © perlmonks.org and Anonymous Monk, jhourcle

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03