Mathew Snyder wrote:
> Tom Phoenix wrote:
>> On 11/28/06, Mathew Snyder <[EMAIL PROTECTED]> wrote:
>>
>>> I have a form I'm trying to fill out.  One of the fields, despite
>>> being named in
>>> the HTML source keeps erroring out on me.
>>> <select name="ValueOfActor">
>>>         fields => {
>>>                 "ValueOfStatus" => $status,
>>>                 "Value0fActor" => $username,
>>>         },
>> Maybe you should use a typeface that shows the difference between O
>> and 0 more clearly. As another good practice, you can use
>> copy-and-paste when you need to be sure to get the exact spelling.
>> Hope this helps!
>>
>> --Tom Phoenix
>> Stonehenge Perl Training
>>
> 
> Upon further review, this wasn't it.  I'm not sure why the 'O' in either of 
> the
> fields above is different but I made sure they are the same in the code.
> 
> It seems like it isn't getting past the login screen for the page I'm trying 
> to
> access.  There's only one form on it with a two fields, one called 'user' and
> the other 'pass' and a submit button.  If I just run this
> 
> #!/usr/bin/perl
> 
> use warnings;
> use strict;
> use WWW::Mechanize;
> use HTML::TokeParser;
> 
> my $username = "msnyder";
> print "Enter your password: ";
> chomp(my $password = <STDIN>);
> my $status   = "open";
> my $url = 'https://rt.xxx.xxxxxxxxxxx.com/Search/Build.html';
> my $textRegex = 'Tickets';
> 
> my $agent = WWW::Mechanize->new();
> $agent->get('https://rt.xxx.xxxxxxxxxxx.com/');
> $agent->form(1);
> $agent->field('user',$username);
> $agent->field('pass',$password);
> $agent->click_button(value => 'Login');
> sleep(10);
> 
> it returns to the prompt with no errors or output.  However, as soon as I add 
> a
> line to follow a link based on either a URL or regex I get an error saying the
> sought after item wasn't found on the page.  It should be noted that the login
> page has the same URL as the page loaded after logging in.  I don't know if 
> that
> matters though.
> 
> I looked at the test subroutines but need to sort them out to figure out how 
> to
> use them to tell me what the issue might be.
> 
> Mathew
> 
Matthew
        My reading of the WWW::Mechanize documentation is that
$agent->click_button returns an HTTP::Response object. I don't think
that would print anything on error. In this situation I would check the
HTTP::Response and possibly print out $agent->content to verify that I
got the page I expected.

Hope that helps
-- MattJ



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to